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
 IS THIS THE BEST WAY TO ONLY GET THE TIME?

Author  Topic 

kingpoop
Starting Member

6 Posts

Posted - 2010-11-08 : 01:49:16
SELECT RIGHT(GETDATE(),8) AS TIMENOW

THANKS
M

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-11-08 : 02:04:02
try this:

select convert(varchar(20),GETDATE(),108) AS TIMENOW
select convert(varchar(20),GETDATE(),14) AS TIMENOW
Go to Top of Page

bhawana
Starting Member

4 Posts

Posted - 2010-11-08 : 02:07:17
If you are using sql server 2008 then You can also try
CONVERT (time, SYSDATETIME())
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-11-08 : 04:56:56
or If you use front end application, do the formation there

Madhivanan

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

- Advertisement -