In this post explains how to use the ISDATE function in SQL Server (Transact-SQL) with syntax and examples.
In SQL Server (Transact-SQL), the ISDATE function returns 1 if the expression is a valid date. Otherwise, it returns 0.
The syntax for the ISDATE function in SQL Server (Transact-SQL) is:
ISDATE( expression )
The value to test whether it is a date.
The ISDATE function can be used in the following versions of SQL Server (Transact-SQL):
Let's look at some SQL Server ISDATE function examples and explore how to use the ISDATE function in SQL Server (Transact-SQL).
For example:
SELECT ISDATE('2014-05-01');
Output: 1
SELECT ISDATE('2014-05-01 10:03');
Output: 1
SELECT ISDATE('2014-05-01 10:03:32');
Output: 1
SELECT ISDATE('2014-05-01 10:03:32.001');
Output: 1
SELECT ISDATE('AODBA.com');
Output: 0
SELECT ISDATE(123);
Output: 0