Date issues

G

Guest

I need to be able to query for the current quarter (2/2005) the previous
quarter and the last four quarters. I have the info in the table by date of
occurrence. Is there a way I could use the current quarter to generate the
rest? for example, the 4 previous quarters are 1/2005, 4/2005, 3/2005,
2/2005. I only want to be able to key in the current quarter from a form to
run a report but I need to compile this data for the report. I'm using
datepart to do some basic stuff but this is too complex for me.
 
M

MGFoster

mkellen494 said:
I need to be able to query for the current quarter (2/2005) the previous
quarter and the last four quarters. I have the info in the table by date of
occurrence. Is there a way I could use the current quarter to generate the
rest? for example, the 4 previous quarters are 1/2005, 4/2005, 3/2005,
2/2005. I only want to be able to key in the current quarter from a form to
run a report but I need to compile this data for the report. I'm using
datepart to do some basic stuff but this is too complex for me.

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

Use DateAdd():

DateAdd("q", -4, CurrentQtrStartDate)

and Between

WHERE date_column BETWEEN DateAdd("q", -4, CurrentQtrStartDate)
And CurrentQtrStartDate

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQnBQD4echKqOuFEgEQJ4xACgmOWRlwdTZ5dczd8Oppgi+3rZuqYAn1Pj
9gdXg7ToRAGce8W1OlaEkEF5
=XdXs
-----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