SQL Server Error 8115 - CONVERT varchar to datetime
Posted on 2002-05-23
The following SELECT statement works fine:
SELECT * FROM MyTable WHERE ISDATE(MyStringField) = 1 AND CONVERT(datetime, MyStringField) < GETDATE()
However, the following UPDATE fails:
UPDATE MyTable SET StatusField = 'Overdue' WHERE ISDATE(MyStringField) = 1 AND CONVERT(datetime, MyStringField) < GETDATE()
The error message is:
Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type datetime.
The statement has been terminated.
Is there a way to figure out which row is causing this problem and can anyone suggest how I can modify my statement to fix this error?