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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Time with AM/PM

Author  Topic 

TMDOSS
Starting Member

33 Posts

Posted - 2009-06-05 : 14:56:39
How Can I display time only from a small date time
with AM and PM . If I use convert statement to display time it displays 13.00,13.01,but user needs to see 01.00 PM
is it possible?

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-06-05 : 15:09:28
If you're using a front end application to present your sql data then you should format the datetime there. Otherwise:
look at Books Online for different format options in "Cast and Convert"

Here's one option:
select convert(varchar, getdate(), 131)

Be One with the Optimizer
TG
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-06-08 : 03:35:43
see this link for dateformats
http://www.sql-server-helper.com/tips/date-formats.aspx
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80563
Go to Top of Page
   

- Advertisement -