![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
The following query works fine against SQL Server 2000 here in the US: SELECT * from TNEWSARTICLES where CreatedOn < '2003-04-25 14:22' But in the UK, it returns this error: 80040e07: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value If I change the format to YYYY-DD-MM, then it does work in the UK. But I was under the impression that the YYYY-MM-DD format will work regardless of regional date format settings. Is this wrong? |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Ted Johnson (t.google (AT) wjohnson1 (DOT) com) writes: The following query works fine against SQL Server 2000 here in the US: SELECT * from TNEWSARTICLES where CreatedOn < '2003-04-25 14:22' But in the UK, it returns this error: 80040e07: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value If I change the format to YYYY-DD-MM, then it does work in the UK. But I was under the impression that the YYYY-MM-DD format will work regardless of regional date format settings. Is this wrong? Yes. YYYY-MM-DD may work well in ODBC regardless of regional settings. But in SQL Server the safe format is YYYYMMDD. You can also use YYYY-MM-DDTHH:MM:SS where T stands for itself. YYYY-MM-DD is not safe in SQL Server. |
![]() |
| Thread Tools | |
| Display Modes | |
| |