Hi all,
I have a start date of, say, 31st October and I want to add forthcoming monthly dates to a table for the 31st of each month.
My inital sequence is:
StartDate = #31/10/2015#
Do
IncrementDate = DateAdd("m", 1, StartDate)
'''stuff
Loop
What happens is that the next date is the 30th November, which is fine as it takes into account that November only has 30 days.
But the following date after that returns 30th December, rather than 31st. Also worried about leap years.
What is the best method to handle this?
Many thanks in advance
I have a start date of, say, 31st October and I want to add forthcoming monthly dates to a table for the 31st of each month.
My inital sequence is:
StartDate = #31/10/2015#
Do
IncrementDate = DateAdd("m", 1, StartDate)
'''stuff
Loop
What happens is that the next date is the 30th November, which is fine as it takes into account that November only has 30 days.
But the following date after that returns 30th December, rather than 31st. Also worried about leap years.
What is the best method to handle this?
Many thanks in advance