Please correct me if I am wrong, but the arguments for DateAdd are DateAdd(datepart,number,date)
Say I am adding:
26:20:10 (26 hours,20mins,10sec) +10:10:10 (10hours,10mins,10sec)
total: 36:30:10 (36hours,30mins,10sec)
Doesn't the DateAdd function use a 12 or 24 hour time base? The date part requirement could be used only for on part of the time I am adding, and the number parameter needs to be a whole number to add to the specified 'datepart'
So DateAdd("hh","mm","ss",26:20:10,10:10:10) or any variation thereof will not work.
No,
use one of DateAdd(ss,yourDate,numberOfCeconds)
DateAdd(s,yourDate,numberOfCeconds)
DateAdd(second,yourDate,numberOfCeconds) wher you want to add seconds
hh/h/hour for hours and ..., without "" John Fill
It'll automadically be added 1 to minutes:
--query
declare @xxx datetime
set @xxx = (select GetDate())
print @xxx
set @xxx = (select dateadd(s, 58, @xxx))
print @xxx
--result
Aug 10 2001 11:35PM
Aug 10 2001 11:36PM
John Fill
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.