Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Conversion Error Expand / Collapse
Author
Message
Posted Tuesday, March 12, 2013 12:13 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 24, 2013 10:16 AM
Points: 25, Visits: 83
Hi, We have just moved our application from SQL Server 2000 to 2005. The following code used to work without a problem, but now I am getting the following error,

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.

update COMMODITY
set comm_qty = 189300,
comm_um = 'LBR',
load_date = '2013-03-11 00:00.00.00',
user_id = 'kmpeters',
proc_date_time = '2013-03-12 11:29.23.831',
calc_weight = 189300,
load_date_time = '2013-03-11 20:50.01.437'
where car_init = 'ALAX'
and car_no = '062545'
and arrv_date_time = '2013-03-05 15:24.06.000'
and compart_no = 1

I would appreciate any help. Thanks
Post #1430037
Posted Tuesday, March 12, 2013 12:54 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 5:02 AM
Points: 68, Visits: 423
Will work if you have your dates with another colon, like '2013-03-11 00:00:00.00'.

John
Post #1430063
Posted Tuesday, March 12, 2013 1:00 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, July 24, 2013 10:16 AM
Points: 25, Visits: 83
Thanks. I should have noticed it.
Post #1430067
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse