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 2000 Forums
 SQL Server Administration (2000)
 update date time data type

Author  Topic 

arunsqladmin
Yak Posting Veteran

74 Posts

Posted - 2008-08-07 : 01:08:31
i have a table which has a column of datetime data type has 61 records in it,i want to change the month from august to july by running a query.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-08-07 : 01:12:35
[code]update t
set datecol = dateadd(month, -1, datecol)
from yourtable t
where month(datecol) = 8[/code]


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

Go to Top of Page

arunsqladmin
Yak Posting Veteran

74 Posts

Posted - 2008-08-07 : 01:57:30
thanks, i got it ,,
Go to Top of Page
   

- Advertisement -