Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my query is
C#
SET LANGUAGE us_english;
SET DATEFORMAT mdy;

SELECT ISDATE('03/18/2010') AS [ISDATE] UNION ALL
SELECT ISDATE('03-15-2010') UNION ALL
SELECT ISDATE('03.15.2010') UNION ALL
SELECT ISDATE('03/2010/15')

when we execute this query it will return
1
1
1
1

Now my question is
In last select statement is
C#
SELECT ISDATE('03/2010/15')

format of date is MYD. But format of my date is MYD

So according this server should be return 0 instead of 1 but it doesn't return 0.
So Please explain me what is Reason behind it.
Posted
Updated 2-Jul-15 1:55am
v2
Comments
ZurdoDev 2-Jul-15 8:04am    
I suggest posting as solution.
John C Rayan 2-Jul-15 9:22am    
Thanks. I have done this.!!

1 solution

Your result works as expected. 03/2010/15 is in MYD format so it returns 1. If you set to DMY format you might return 0.

Check the documentation here
https://msdn.microsoft.com/en-us/library/ms187347.aspx
 
Share this answer
 
v6

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900