Robert Szymanski-440859
SSC Eights!
Points: 957
More actions
August 9, 2007 at 11:41 am
#180265
I have a table where I need to increment the year of a datetime field by one year. The rest of the date must remain the same.
Can someone help me out?
Lynn Pettis
SSC Guru
Points: 442447
August 9, 2007 at 11:50 am
#725822
update dbo.TargetTable set
targetfield = dateadd(yyyy, targetfield, 1)
where
(any criteria to restrict the update)
August 9, 2007 at 12:38 pm
#725831
Hi Lynn, thanks for your reply.
I was able to get it running using the following:
targetfield = dateadd(yyyy, 1, targetfield )
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply