SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Formatting DateTime
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

silas2
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"?

tkizer
Almighty SQL Goddess

USA
36941 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.

Tara
Go to Top of Page

Kristen
Test

United Kingdom
22403 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)

Kristen
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000