SQL ISDATE

The SQL ISDATE is one of the Date and Time Function, 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:

ISDATE (Expression)

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

SQL ISDATE Example

In this Date and Time Function example, we will show you how to use IS DATE in SQL Server to change the time zone (offset value)

-- 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')
SQL ISDATE Example