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
 IS THIS THE BEST WAY TO ONLY GET THE TIME?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kingpoop
Starting Member

USA
6 Posts

Posted - 11/08/2010 :  01:49:16  Show Profile  Reply with Quote
SELECT RIGHT(GETDATE(),8) AS TIMENOW

THANKS
M

pk_bohra
Flowing Fount of Yak Knowledge

India
1182 Posts

Posted - 11/08/2010 :  02:04:02  Show Profile  Reply with Quote
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 - 11/08/2010 :  02:07:17  Show Profile  Reply with Quote
If you are using sql server 2008 then You can also try
CONVERT (time, SYSDATETIME())
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22772 Posts

Posted - 11/08/2010 :  04:56:56  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
or If you use front end application, do the formation there

Madhivanan

Failing to plan is Planning to fail
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.06 seconds. Powered By: Snitz Forums 2000