ISDATE function is used to check that the specified expression is a valid date or not.
ISDATE returns 1 if the input expression is a valid date otherwise it returns 0.
Syntax of ISDATE Function :
ISDATE (expression)
expression is any valid sql server expression. It is of type varchar.
Return type of ISDATE function is an integer.
Examples of ISDATE Function :
Example 1 : Use of ISDATE function in select clause
SELECT ISDATE('10/13/1998')
Output
1
Above example returns 1 means specified string is a valid date.
Example 2 : Use of ISDATE function to check column value of table in select clause
SELECT ISDATE(OrderDate)
FROM Invoices
WHERE OrderID = 10888
Output
1
Above example returns 1 for OrderDate column value in invoices table.