Hello,
I'm trying to increase the time between dates by a set amount. For example, I want to add two months to the time between date 1,2 and 3. I'm having trouble incrementing my 'date counter'...
DECLARE @monthDiff int
SET @monthDiff = 1;
UPDATE [Table1]
SET [Date] = DATEADD(MONTH, (SET @monthDiff = @monthDiff + 1), [Date])
WHERE [ID] IN
(
SELECT [ID]
FROM [Table2]
WHERE [Description] = 'HE'
);
An example might help...
Original dates:
01/04/1984
01/05/1984
01/06/1984
New dates:
01/04/1984
01/06/1984
01/08/1984
Any ideas?
I'm using SQLServer 2005.
Thanks.