Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 UK Date Format

Author  Topic 

djdanrt
Starting Member

15 Posts

Posted - 2007-06-05 : 05:29:50
Im in the UK and use SQL 2005 standard and it seems to be set to US date format. The servers all set up for UK date. How do you change SQL2005 to the UK date format(date,month,year)?

Thanks
Dan

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-06-05 : 05:32:10
[code]SET DATEFORMAT DMY
GO[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

djdanrt
Starting Member

15 Posts

Posted - 2007-06-05 : 06:13:41
Isnt there a setting in studio manager to change it to UK format? That setdate format doesnt seem to work. Am I missing something simple? You would think it would pull from the server settings rather than have it default to US date format. Does everyone in the UK have to use the set dateformat dmy?

Dan
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-06-05 : 06:29:32
First of all, SET DATEFORMAT is only useful when you want SQL Server to interpret character date values as per specific format. Secondly, datetime data is stored in SQL server in its internal format, so you don't have to worry about format. Thirdly, your problem seems to be formatting problem and it should be handled at front-end.

How did you find out that dates are stored in US format?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-05 : 07:27:52
1 Use proper datatype DATETIME
2 Dont worry on how dates are stored in the table
3 Format the dates in front end if you use
4 When expressing date literals, use YYYYMMDD format

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-06-05 : 08:29:41
Madhivanan/harsh -- I think you are missing the point in this case -- he is asking how to configure a front-end client to show dates in a certain format, not about storing or formatting dates in SQL.

djdanrt -- Are you using SQL Server Management Studio? I believe it uses your computer's settings to determine how to format the date. How is your computer configured to display dates?

update: Yes, it just uses your PC's regional settings. Make sure your PC is configured to use the UK date format (or whichever one you want) in the control panel.


- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -