ISDATE function is determines whether the input
expression is valid date.
Syntax:
ISDATE (Expression)
Returns:
ISDATE function returns integer value.
1- Returns the weather input expression is valid date or
time.
0- Returns the weather input expression is not valid
date or time.
Example
-1
SELECT ISDATE(GETDATE()) AS [ISDATE]
Output:
In above example returns 1 because Getdate is valid
date.
Example
-2
SELECT ISDATE('SQL SERVER') AS [ISDATE]
Output:
In above example returns 0 because not valid date.
Comments
Post a Comment