October 7, 2008 at 8:05 am
Hi,
I am trying to create a function which will extract the time element of the getdate function and then add an additional say 3 minutes to this value. It has to be in 24 hour format.
The following strips out the time element from getdate
SELECT replace (CONVERT(VARCHAR,getdate(),8),':','') as time
The script below works however I do not know how to adjust it when the time is at 58 or 59 minutes or
select (left(replace (CONVERT(VARCHAR,getdate(),8),':',''),4)+3)*100
Please help 🙁
October 7, 2008 at 8:19 am
Why won't DateAdd(Minute, 3, getdate()) work?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
October 7, 2008 at 8:31 am
Thanks the dateadd function works fine!
🙂
I just discounted it as it had date in its title
:blush:
December 13, 2010 at 1:59 pm
select LTRIM(RIGHT(CONVERT(varchar,getdate()), 7)) AS TIME_1
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply