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
 Current Time

Author  Topic 

sanjay5219
Posting Yak Master

240 Posts

Posted - 2011-08-08 : 04:37:30
Hi All,

I need a query which give me current time in AM PM format in sql.
Please help

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-08 : 04:52:39
select RIGHT(CONVERT(varchar(30),getdate(),109),14)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-08-08 : 07:34:10
If you want to show formatted dates in front end application, do formation there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -