Question: What is the Biggest Limitation of ISDATE() Function?
Answer: I really wish the original question was asked in this format. Instead in the last meeting, the question was actually asked was following:
Why do the first query returns 1 and second query returns 0?
SELECT ISDATE('6666-04-30') IsValidDate
SELECT ISDATE('1111-04-30') IsValidDate
Honestly, the reason, I do not like questions such as this because they really are just dependent on people’s knowing very special information. I rather prefer to ask question which gives more opportunity to candidate to be correct and feel more comfortable.
I personally believe there are two biggest limitations of the ISDATE () function.
Limitation 1: When we are using four digit format in yyyy format, it supports only year 1582 to 9999.
Limitation 2: Two digit years, sometimes can be confusing as it does not represent which century they represent.
If we ask candidates to answer the limitation of ISDATE () function they can for sure think of some more valid answers. Once they know the answer they can list them in the order of priority. This way they they have more chance to demonstrate their knowledge.
Meanwhile the limitation 1, listed above is the reason why Query 1 gives us correct answer and query 2 gives us incorrect answer.
Let me know what you think of this question. I would like to know your opinion in the comments section.
Reference: Pinal Dave (https://blog.sqlauthority.com)