Validate Date and Time values
Overview
The validate date and time value function covered in this section is:
ISDATE
caution
This function isn't currently supported in PostgreSQL deployments of the Cinchy platform. Please check back at a later time. For a full list of in-progress function translations, see the CQL functions reference page.
ISDATE
checks an expression to see if it's correct.
It will return 1 if the expression is a valid date, time, or datetime value; otherwise, it will return 0. ISDATE will also return 0 if the expression is a datetime2 value.
Syntax
ISDATE ( expression )
Arguments
Argument | Description | Example |
---|---|---|
expression | Is a character string or expression that can be converted to a character string. The expression must be less than 4,000 characters. Date and time data types, except datetime and smalldatetime, aren't allowed as the argument for ISDATE . | 009-05-12 10:19:41.177 |
Return types
int
Example
Using ISDATE to Test Valid datetime Expression
IF ISDATE('2009-05-12 10:19:41.177') = 1
SELECT 'VALID'
ELSE
SELECT 'INVALID'