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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 dateadd function

Author  Topic 

juicyapple
Posting Yak Master

176 Posts

Posted - 2008-08-14 : 21:41:51
How to update the column dtRange to 3 months smaller from current date?

dtRange
-------------
1-Aug-2007
10-Sept-2007

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-08-14 : 21:46:35
[code]update t
set dtRange = dateadd(month, -3, dtRange)
from yourtable t[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -