siweb (9/4/2008)
I do the following:
select value from table
where name = 'DateTime'
and IsDate (value) = 0
And no rows return. This should indicate that all the string values is recognized as a valid date.
Yet, I still get the "Conversion failed when converting datetime from character string" error when executing this statement. I'm stumped. Is this a sql server bug?:
select value from table
where name = 'DateTime'
and IsDate (value) = 1
and cast ( value as datetime ) between cast ('2008-08-26 00:00:00' as datetime ) and cast ( '2008-08-28 23:59:59' as datetime )
you've already cast value once so its not required again in the between operators, just use
between ('2008-08-26 00:00:00') and ( '2008-08-28 23:59:59')
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉