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
 Formatting DateTime
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

United Kingdom
65 Posts

Posted - 08/17/2005 :  13:58:29  Show Profile  Reply with Quote
Is there a way of formatting a DateTime datatype, so e.g. "2005-08-17 18:27:16.753" could format to "dd/mm/yy hh:mm"?

Almighty SQL Goddess

38200 Posts

Posted - 08/17/2005 :  14:03:01  Show Profile  Visit tkizer's Homepage  Reply with Quote
Yes check out the styles available with the CONVERT function in SQL Server Books Online.

Go to Top of Page


United Kingdom
22859 Posts

Posted - 08/17/2005 :  14:03:23  Show Profile  Reply with Quote
1) Use the application layer, not SQL [Stock answer - sorry!]
2) CONVERT(varchar(14), MyDate, 3) + ' ' + CONVERT(varchar(5), MyDate, 8)

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.02 seconds. Powered By: Snitz Forums 2000