lifeson
10-15-2008, 07:34 AM
I have the following which generates a date based on the first day of a given month
sDate = Me.txtStart.Value
alwSdate = DateSerial(Year(sDate), chkMonth, 1)
I was using this to calculate the same date plus 1 year
alwEdate = DateSerial(Year(sDate) + 1, chkMonth, 1)
But I actually need it to be 1 day less
i.e.
start 1st March 2008 the end date would be 28th Feb 2009
so how many days are there in
Year(sDate) +1 and chkmonth-1
Any ideas?
sDate = Me.txtStart.Value
alwSdate = DateSerial(Year(sDate), chkMonth, 1)
I was using this to calculate the same date plus 1 year
alwEdate = DateSerial(Year(sDate) + 1, chkMonth, 1)
But I actually need it to be 1 day less
i.e.
start 1st March 2008 the end date would be 28th Feb 2009
so how many days are there in
Year(sDate) +1 and chkmonth-1
Any ideas?