Wednesday, September 14, 2005

SQL : Date format and style

I'm always getting confused between the UK and US formats:

For UK format i.e. dd/mm/yyyy, the style parameter is 103

CONVERT (DATETIME, '18/12/2005 00:00:00', 103)

For US format i.e. mm/dd/yyyy, the style parameter is 101

CONVERT (DATETIME, '18/12/2005 00:00:00', 101)

And I really wish that people would give examples like '18/12/2005' where it's quite obvious which is the date and which is the month instead of the normal examples like '04/06/2005' where it could be either.

Enjoy!

No comments: