views:

95

answers:

1

Is there any way for me to test a data conversion in a select statement and only return rows where the conversion fails?

IE:

SELECT * FROM my_table WHERE CONVERT(datetime, [colA]) = NULL

I'm open to any SQL hacks/trickery.

+6  A: 

Use isdate

SELECT * FROM my_table
WHERE isdate(colA)  = 0

See also Trouble With ISDATE And Converting To SMALLDATETIME

SQLMenace
Awesome! This solved my problem perfectly.
Jared