The ISDATE and ISNUMERIC Functions (version 6.5)

ISDATE Function
Checks a variable or column with varchar datatype for valid date format. The function returns 1 when the variable or column contains a valid date, otherwise it returns 0.

In this example, the value 1 is returned:

SELECT ISNUMERIC(zipcode) FROM address
  
ISNUMERIC Function
Checks a variable or column with varchar datatype for valid numeric format. The function returns 1 when the variable or column contains a valid numeric value, otherwise it returns 0.

In this example, the value 1 is returned:

declare @datestring varchar(8)
SELECT @datestring ="12/21/95"
SELECT ISDATE(@datestring)

The following table is a summary of the return values for the ISDATE and ISNUMERIC functions for a selection of examples.

Column (varchar)
value
ISDATE
return value
ISNUMERIC
return value
NULL 0 0
abc 0 0
100 0 1
100 0 1
100 a 0 0
100.00 0 1
.01 0 1
-100.1234e-123 0 1
.231e90 0 1
$1000 0 1
$100 0 1
$100 a 0 0
$100.12345 0 1
-$100.12345 0 1
$-1000.123 0 1
as100 0 0
1a00 0 0
1995-10-1 1 0
1/20/95 1 0
1995-10-1 12:00pm 1 0
Feb 7 1995 11:00pm 1 0
1995-10-1 1 0
13/43/3425 0 0
1995-10-1a 0 0
1/23/95 1 0