SQL ISDATE

The SQL ISDATE is one of the Date and Time Functions, which will check whether the given expression is a Date or not. If the specified expression is Date, Time, or Datetime, then it will return 1. Otherwise, 0.

The basic syntax of the ISDATE is as shown below. Please refer to the list of SQL Date functions available on our SQL Tutorial page.

ISDATE(Expression)

The return value of this function always depends upon the SQL SET DATEFORMAT and SQL SET LANGUAGE statements. If the given expression is DATETIME2, then it will return 0

SQL Server ISDATE Function Example

In this Date and Time functions example, we will show you how to use IS DATE in SQL Server to change the time zone (offset value). Please refer to the SQL DATENAME and SQL DATEDIFF functions.

-- Using Date
SELECT ISDATE('2018-01-02')	

-- Only Time Value
SELECT ISDATE('15:02:13.950')	

-- Using Date and time
SELECT ISDATE('2018/01/02 15:02:13.950')

-- Try on datetime2 datatype value
SELECT ISDATE('2018/01/02 12:03:28.0000000')
ISDATE Function to check Date Example
Categories SQL