Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

ISDATE function not working as expected

$
0
0
[code="sql"]Declare @var varchar(100)set @var = '2000'select case when ISDATE(@var ) =1 then 'Valid Date' when ISDATE(@var ) =0 then 'Invalid Date' END[/code]In the above code I have given value for @var is 2000, which is not date. but if I check with the isdate function it returns as it is a valid date.what we could do to get the expected output?Thanks in advance

Viewing all articles
Browse latest Browse all 3145

Trending Articles