isdate

Description

Determines whether an input expression is a valid datetime value.

Syntax

isdate(character_expression) 

Parameters

character_expression

is a character-type variable, constant expression, or column name.

Examples

Example 1

Determines if the string 12/21/2005 is a valid datetime value:

select isdate('12/21/2005')

Example 2

Determines if stor_id and date in the sales table are valid datetime values:

select isdate(stor_id), isdate(date) from sales
---- ---- 
0    1 

store_id is not a valid datetime value, but date is.

Usage

Returns 1 if the expression is a valid datetime value; returns 0 if it is not. Returns 0 for NULL input.