Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
harshal_in
Aged Yak Warrior
633 Posts |
Posted - 2002-07-11 : 02:26:42
|
hi,can anyone tell me how to substract minutes,hours,weeks from a datetime value?thnxsharsh |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-07-11 : 02:36:19
|
| dateadd function?or for anything day/time basedselect @d = @d - 'dd jan 1900 hh:mm:ss'e.g. to subtract 1 day 5 hrsselect @d = @d - '02 jan 1900 05:00:00'orselect @d = dateadd(hh,-5,dateadd(dd,-1,@d))==========================================Cursors are useful if you don't know sql.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|