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:

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 Server ISDATE Function Example

In this DateTime example, we will show you how to use IS DATE in 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 Server ISDATE Function to. check Date Example
Categories SQL