Verify whether the expression can be interpreted as a valid date.
|
SELECT ISDATE(‘2017-08-25’); |
The ISDATE() function evaluates an expression and returns 1 if it represents a valid date; otherwise, it returns 0.
|
ISDATE(expression) |
|
Parameter |
Description |
|
expression |
Required. The expression that is being evaluated for validity as a date. |
|
Return type: |
int |
|
Works in: |
SQL Server (from 2008 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse |
Verify if the expression represents a valid date.
|
SELECT ISDATE(‘2017’); |
Determine whether the expression is a valid date.
|
SELECT ISDATE(‘Hello world!’); |