Thursday, March 29, 2012

Converting DateTime

Hello Everyone and thanks for your help in advance. I have an application that inserts a variety of values into a SQL Server database. Among the columns are three DateTime values. I have code working properly on my test server, but when I port the identical code to my production database, I get the following error:

Arithmetic overflow error converting expression to data type datetime. The statement has been terminated

When I remove any type of insert involving date, the application works. I have tried the date in various formats, for instance "09/12/2001" and "20010912", but still get the same error. Obviously, there must be differences in the SQL Servers, but I have never run into this problem before and the current server is running many applications involving dates. I haven't got a clue as to how to solve this problem. Any help is greatly appreciated. Thanks.hi kmcnet,
i had the same problem. but i was using query in code at that time but now i am using stored procedure and i can pass the date value now. no problem with that. anyway that was really really annoying thing. at one point i had used varchar to store date in database which i used to change to datetime datatype before displaying. but i think that wasn't a proper solution.sqlsql

No comments:

Post a Comment