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
 Formatting DateTime

Author  Topic 

silas2
Yak Posting Veteran

65 Posts

Posted - 2005-08-17 : 13:58:29
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

38200 Posts

Posted - 2005-08-17 : 14:03:01
Yes check out the styles available with the CONVERT function in SQL Server Books Online.

Tara
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-08-17 : 14:03:23
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
   

- Advertisement -