ericl
|
Posted: 11/27/2003, 8:02 AM |
|
When updating a maintenance table I receive an error -
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. (Microsoft OLE DB Provider for SQL Server)
The field type in sql server is datetime.
It will accept dates as if in us format ie 01/01/2003 but generate an error if a date such as 21/01/2003 is entered as if it is picking up a us date format.
Project settings are dd/mm/yyyy. Date format fields are linked to database, format in field properties is dd/mm/yyyy, dbformat properties are dd/mm/yyyy
Regional settings on both server and workstation are UK.
Any help greatly appreciated
|
|
|
Edd
|
Posted: 11/27/2003, 9:58 PM |
|
As an antipodean (who lost the Rugby) I don't know whether to help you or not, but the rule of thumb I always use is save ALL dates as YYYY-DD-MM, this is a format field called DBFormat at the bottom of your date field in CCS.
Hope this helps (and hope you choke on drinking champagne from the cup).
Regards,
Edd
|
|
|
ryan
|
Posted: 11/28/2003, 4:46 PM |
|
Hi Ericl :
That was preferred venturing through SQL (English-British) format US dates are
mm/dd/yyyy right and Brit dates are dd/mm/yyyy
In SQL Server 2000 whatever date January 2, 2002, 01/04/2002, 04/01/2002 are all accepted as long as they are valid dates.
Try using Session.LCID, I had that problem before. On common.asp set it to
Session.LCID = 2057
That means your site application will handle British format dates as the database conforms to English British. Session.LCID = 1032 I think is US please verify on aspin.com the values because I could not memorize all the values.
But try setting this step please Session.LCID = 2057 do not venture anymore on CAST, CONVERT or DATEADD, they are useful in most cases but in this date issue practically futile.
Have fun!!!
|
|
|
|