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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Changing Date column to different format
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

United Kingdom
550 Posts

Posted - 01/17/2013 :  08:31:22  Show Profile  Reply with Quote
Hello there

I have a datetime column that reads 1997-11-25 16:29:00.000

is there a way i can update the whole column to permanently read

eg todays date 17-01-2012 12:22:00.000



James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 01/17/2013 :  08:47:08  Show Profile  Reply with Quote
Assuming that data type of the column is DATETIME, DATETIME2 or one of the other datetime types, the data is stored in SQL Server without regard to the formatting. So what you are observing when you select is simply an artifact of the default format applied (which depends on your locale setting and language setting).

If you want to get the results in the format you have indicated (or any other format) you can format it approriately. So to get the format you specified, you would do this:
CONVERT(VARCHAR(32), YourDateColumn, 120)
120 is a format style. The format styles available are listed on this MSDN page

Usually it is better to do this type of formatting at the point where the data is consumed - for example in a front-end application or in Reporting Services.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000