I am having problems getting the end date to calculate correctly.
I start with Quarter '03/02', (YY/QTR), for this it means it is for the 2nd qtr of 2003. My goal is to get the begin & end dates for each 'month' in the quarter, hence, I want to calculate the begin & end of the month dates for April, May & June 2003 :
so my starting point is:
firstMonthBegin = vcBegMM & "/" & vcBegDD & "/" & vcBegYY
firstMonthEnd = vcEndMM & "/" & vcEndDD & "/" & vcEndYY
which translates to:
firstMonthBegin = '04/01/2003'
firstMonthEnd = '04/30/2003'
*these are the begin & end dates for the first month in the period
Now, I use DateAdd to get the begin & end dates for the next month (May)
SecondMonthBegin = DateAdd("M", 1, CDate(FirstMonthBegin))
SecondMonthEnd = DateAdd("M", 1, CDate(FirstMonthEnd))
****Here is my problem:
* This dateAdd function calculates the begin date (SecondMonthBegin) correctly as '05/01/07' BUT
* it is calculating the end date (SecondMonthEnd) with a value of '05/30/07' and it should be '05/31/07' which is the last day of the month.
Can you tell me what I am doing wrong????
