date restrictor questions

  • Thread starter Thread starter Chuck W
  • Start date Start date
C

Chuck W

Hello,
I have a date field called DR. I need to capture all date that are between
two and eight months old starting at the first day eight months ago and
ending with the last day of the month two months ago. So if I were to run it
today, it would be all transactions between 9/1/08 and 3/31/09. If I were to
run it in June, it would be between 10/1/08 and 4/30/09. Can someone help?

Thanks,
 
Use the DateSerial function.

This;

DateSerial(Year(Date()), Month(Date())-8, 1)

will return the first day of the month that is 8 months prior
to the current month.

This;

DateSerial(Year(Date()), Month(Date())-1, 0)

will return the day prior to the first day of last month (i.e. the last
day of the month before that)
 
Back
Top