timothy bates (11/2/2010)
Accurate question. I think any question that uses a date with obvious notation to remove all ambiguity such as '2010-Jan-01' is fine. We clearly understand which is the year, month, and day. '201000205' while most would consider it to be February 5, 2010; 5 February 2010; or 2010 Februrary 5 it isn't perfectly clear.I would have liked to seen this instead:
DATEADD(MONTH, 1, '2010-Jan-30')
Feb 28 is correct not Feb 27 day preceeding end of month nor March 1 30 days post Jan 30.
Tim
The problem with '2010-Jan-01' is that it is not even a valid date with many or most language settings.
set language italian;
select DT = convert(datetime,'2010-Jan-01')
Result:
L'impostazione della lingua è stata sostituita con Italiano.
Server: Msg 241, Level 16, State 1, Line 3
Conversione non riuscita durante la conversione di una stringa di caratteri nel tipo di dati datetime.
'201000205' is perfectly clear to SQL Server. It will only interpret it one way, as YYYYMMDD, no matter what the setting of LANGUAGE or DATEFORMAT.