Query for last 30 days and 30 to 60

A

Aaron

Hello,

I am trying to create a query from table Recruits that shows the last 30
days recruits sum from todays date and the last 30 to 60 days recruits sum.

I have three columns in the table. Employee, Date recruited and QTY

Any help would be great. Thanks in advance,
Aaron
 
M

MGFoster

Aaron said:
Hello,

I am trying to create a query from table Recruits that shows the last 30
days recruits sum from todays date and the last 30 to 60 days recruits sum.

I have three columns in the table. Employee, Date recruited and QTY

Any help would be great. Thanks in advance,
Aaron

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

Not sure what you mean by "recruits sum" so will show my guesses:

Last 30 days "sum":

SELECT SUM(QTY) As [30 Days Sum]
FROM Recruits
WHERE [Date recruited] BETWEEN Date()-30 And Date()


Last 30 to 60 days "sum":

SELECT SUM(QTY) As [30-60 Days Sum]
FROM Recruits
WHERE [Date recruited] BETWEEN Date()-60 And Date()-31

I used -31 to avoid recounting the 30th day SUM.

--
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/AwUBSRocyoechKqOuFEgEQJeyQCfVs1v94glLexnMCCrOWl5WsIRSTUAoJfh
G4bO11dZwV02pOU8HpxiF6tv
=TpDc
-----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