Dreaded DateAdd ?

WineSnob

Not Bright but TENACIOUS
Local time
Yesterday, 19:10
Joined
Aug 9, 2010
Messages
211
I am filling a table with calculated data. There is a StartDate field (supplied as a variable) I need to fill the table with the next month first day. It is a payment due schedule.
I will supply 1/1/2013 then I need to fill the table with
2/1/2013
3/1/2013
4/1/2013 ....etc until end of loop.
I have tried
ScheduledPaydate= StartDate.Addmonths(1)
I tried
ScheduledPaydate = DateAdd("m", 1, startdate)

Any ideas?
Thanks
 
You are not increasing the month as you loop
Don't know if you can DateAdd("m",n,startdate) where you increase n by 1 each time round the loop, but you can with Dateserial.

Dim M as Long

For M =1 to 11
DateSerial(Year(startdate),Month(startdate) + M,1)

next M

Brian
 

Users who are viewing this thread

Back
Top Bottom