Pankaj  Kumar Choudhary

Pankaj Kumar Choudhary

  • 59
  • 26.8k
  • 13.1m

Why function return 1

Jul 2 2015 7:04 AM
Hello Friend i was doing some exercise on  date time function and face a problem please Help me to solved out this problem
 
my query is
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 last select statement is 
 SELECT ISDATE('03/2010/15')  
format of date is   MYD. But i define the format of date MDY 
 
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...........
Thanks for reading my Question..........

Answers (7)