Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last 3 months Avg Purchase 1

Status
Not open for further replies.

molly

Technical User
Jul 17, 2000
219
0
0
US
This request seems harder than i first thought. I need to have the last 3 months average purchases from today's date (the date when i run the Query).

i have 4 fields: RawID, PO Date, Qty, Purchase$.

Is there an Access command that almost does this?

Your advise can point me in the right direction.

thank you. Molly
 
maybe something like:
(typed, not tested, complete guess!)

Code:
SELECT Month([PO Date]), AVG(Purchase$) FROM tableName
WHERE [PO Date] BETWEEN Date() - 90 AND Date()
GROUP BY Month([PO Date])

Leslie

In an open world there's no need for windows and gates
 
Les - Homerun. this is great. The Last 3 months per RawID came in and your AVG command reduced the answer to just 1 row per RawID. i would have mistakenly made 2 qry's and your method did it in 1 qry.

thanks so much.
Molly
 
great! I'm glad it worked....thanks for the star!

Les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top