I just need TIME not Date.

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2005
Posts: 1
Reputation: jgoering is an unknown quantity at this point 
Solved Threads: 0
jgoering jgoering is offline Offline
Newbie Poster

I just need TIME not Date.

 
0
  #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!
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 40
Reputation: noman78 is an unknown quantity at this point 
Solved Threads: 0
noman78's Avatar
noman78 noman78 is offline Offline
Light Poster

Re: I just need TIME not Date.

 
0
  #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 Quick reply to this message  
Join Date: Aug 2008
Posts: 6
Reputation: AntonioGK is an unknown quantity at this point 
Solved Threads: 1
AntonioGK AntonioGK is offline Offline
Newbie Poster

Re: I just need TIME not Date.

 
0
  #3
Aug 13th, 2008
Hello,

This expression give you only the time.
  1. CONVERT (varchar, GETDATE(), 114)
  2. -- this is the result
  3. -- 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 Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC