Click to See Complete Forum and Search --> : MS SQL 2000 Date format error


paul_watkins
10-26-2007, 05:36 AM
Hi

I hope someone can help. I'm having a problem inserting a date into a datetime column in a SQL database.

I have a column that records the date when an entry is updated, it then uses this to order the content. It was all working fine when i set everything up but now it doesn't.

When i create a new entry and insert the date it's fine, but when i try and update an entry i get the following error

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[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.

Does anyone know why this might be happening?

Thanks for your help.

mattyblah
10-26-2007, 04:55 PM
the problem is sql server doesn't like the format you are using with the update. you should read up on the universal format for sql server and use that format when inserting/updating dates.

russell
10-27-2007, 01:34 AM
use this format

20071027 (ccyymmdd)