date restrictor questions

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,
 
B

Beetle

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top