|
| |
|
|
Topic Starter
Posts: 49 From: Canada, eh? Status: offline
|
Update SQL datefield - 4/4/2002 11:34:46
Here is my SQL statement: sQry="UPDATE Webcasts SET Copyright=convert(datetime, '" & Request.Form("Copyright") & "'), Title='" & Request.Form("Title") & "', Expiry=convert(datetime, '" & Request.Form("Expiry") & "') WHERE ID=" & Request.QueryString("ID") & "" Which outputs this: UPDATE Webcasts SET Copyright=convert(datetime, '22/02/2002'), Title='Marc Title for testing', Expiry=convert(datetime, '22/02/2003') WHERE ID=91 But I get the error: Description: [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. Number: -2147217913 (0x80040E07) Source: Microsoft OLE DB Provider for ODBC Drivers I've looked in my database, and I see that the table shows the dates in the format dd/mm/yyyy, which is the way that I'm inputting it. What is the problem????
|
|
|
|
Spooky
Posts: 26606 Joined: 11/11/1998 From: Middle Earth Status: offline
|
RE: Update SQL datefield - 4/4/2002 20:33:15
From BOL: When transforming a string (DBTYPE_WSTR) into a date (DBTYPE_DATE) or time (DBTYPE_TIME) column from a text file, only one date or time format (yyyy-mm-dd hh:mm:ss.fffffffff) is accepted by the OLE DB data conversion service component. Use the Date Time String transformation, or code a Microsoft ActiveX® script transform using the CDate function to transform dates correctly SQL expects that format to be supplied §þððk¥ Database / DRW Q & A VP-ASP Shopping cart Spooky Login
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|