November 21, 2013 at 9:08 am
I cannot use parse..
Using Sql 2008..
Thanks though it was really great info...
November 21, 2013 at 8:54 pm
Note that ISDATE() has tons of odd interpretations as well.
For example, '2013' returns as a valid date:
SELECT ISDATE('2013')
Which makes sense if you consider this returns 2013-01-01:
SELECT CAST('2013' AS DATE)
However, do you think of '2013' by itself as a valid date?
Meanwhile, TRY_PARSE says '2013' is not a valid date:
SELECT TRY_PARSE('2013' AS DATE)
but of course 2013-01-01 is deemed valid:
SELECT TRY_PARSE('2013-01-01' AS DATE)
So, choose your validation techniques wisely and do not assume the name of a function matches the behavior that might be implied by your interpretation of that name.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 2 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy