Previous Reporting Period Query

M

MikeRo

I have created a query where people can enter a beginning and ending date to
find data entered during that time (day/month/year). Using the initial input
from the initial time frame, how can I get the information from the previous
year from that time frame to display? This will allow us to see positive or
negative results for the given month the previous year.
 
M

MGFoster

MikeRo said:
I have created a query where people can enter a beginning and ending date to
find data entered during that time (day/month/year). Using the initial input
from the initial time frame, how can I get the information from the previous
year from that time frame to display? This will allow us to see positive or
negative results for the given month the previous year.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just use DateAdd() to get the previous year's dates:

WHERE date_column_name BETWEEN [Beginning Date] And [Ending Date]
AND date_column_name BETWEEN DateAdd("m", -12, [Beginning Date]) And
DateAdd("m", -12, [Ending Date])

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSdJXjYechKqOuFEgEQJprgCg34sYlJPfkUinwdwWeHTSk2UDnTYAn1K1
vS4rJiuLTfDYzF9vwB7kmIvV
=mp/S
-----END PGP SIGNATURE-----
 

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