Are you absolutely sure that all the values in the field will convert to a valid date? Usually when people don;t use datetime fields for dates, the users enter incorrect information in the database. You might have one or more values that says something like 20020230 which is acceptable integer data but is not a real date.
But the syntax error is not the same when user insert 20020230 or 20020350
If the error is because of this kind of junk insert,it should return
Server: Msg 242, Level 16, State 3, Line 1
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
The statement has been terminated.
-------------------------------------------------------
I think the query KizMar wrote is wrong.You should check the correct syntax
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.