|
Posted by Erland Sommarskog on 08/05/06 22:12
DFS (nospam@dfs_.com) writes:
> Does SQL Server have problems recognizing m/d/yyyy? I hadn't heard.
It may have. Try this:
SET LANGAUGE German
go
SELECT convert(datetime, '9/5/2003')
Not talking about that many readers in this newsgroup find strings like
8/29/2006 as pure garbage if it supposed to be a date. There are only
12 months per year where I live.
There are three safe formats in SQL Server:
YYYYMMDD
YYYY-MM-DDTHH:MM:SS[.fff]
YYYY-MM-DDZ
T and Z here represent themselves. The last format is only in SQL 2005.
All other formats are ambiguous and can be interpreted differently
depending on the langugae setting.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|