RSS Forums RSS
Please support our MS SQL advertiser: Programming Forums
Views: 4689 | Replies: 2
Reply
Join Date: Nov 2005
Posts: 1
Reputation: jgoering is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jgoering jgoering is offline Offline
Newbie Poster

I just need TIME not Date.

  #1  
Nov 6th, 2005
I'm working on a project that just needs to know that its 08:00 or 14:01. I dont need or want to store anything about date.

When I store the time and then try to check it against the current time I'm runnig into problems.

where (timeofevent = Convert(char(19),current_timestamp))

this doesnt work because Convert(char(19),current_timestamp
returns Nov 6 2005 6:39PM when what I need is 6:39PM or 18:39.

I need help getting the current time in that format.

THANKS!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2005
Location: Dubai,UAE
Posts: 36
Reputation: noman78 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
noman78's Avatar
noman78 noman78 is offline Offline
Light Poster

Re: I just need TIME not Date.

  #2  
Nov 23rd, 2005
u can use combination of SubString and instr function and can extract time from the date-time stamp
if is wht u wnat get back to me, i will give u the example
Reply With Quote  
Join Date: Aug 2008
Posts: 6
Reputation: AntonioGK is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
AntonioGK AntonioGK is offline Offline
Newbie Poster

Re: I just need TIME not Date.

  #3  
Aug 13th, 2008
Hello,

This expression give you only the time.
CONVERT (varchar, GETDATE(), 114)
-- this is the result
-- 10:24:55:640



I hope this help you.
Last edited by AntonioGK : Aug 13th, 2008 at 2:28 pm. Reason: Add Result
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:48 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC