Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: henk01Hi Mick,
I guess you want to be slightly careful here with the end date, if you want the last day of the 6th month (previous).
In that case you may want to ensure you first find the first day of the 5th month, then -1 day to obtain the last day of that previous month (i.e. last day of the 6th month).
# todaysDate contains the date, in date format
# and written slightly differently
FirstOfMonth = date(todaysDate.year(),todaysDate.month(),1)
StartDate = FirstOfMonth.dateAdjust(-6,"months")
EndDate = FirstOfMonth.dateAdjust(-5,"months").dateAdjust(-1)
If you test with e.g. a date in Aug-2011, I guess you�ll want a start date of 01-Feb-2011, and end date of 28-Feb-2011.
Best Regards,
Henk