Sum of Invoice Quantity of Date Range

S

Supe

I'm trying to set up a query that will give me a total of each item ordered
by a store in a specific data range where if they ordered an item 5 different
times, it would only list the store once and the total of the 5 orders they
placed. I am using the field below from my table.

Invoice Week
Store Number
Item UPC
Inv Qty

I set the date range I want in the Invoice Week and unselected the Show box
so it does not appear in the results and I changed the Total to Sum for the
Invoice Quantity. When I run my query, it still lists the store number and
the UPC multiple times as if it is showing it by each week it was ordered.
What am I doing wrong?
 
J

Jeff L

This would probably be easier if you did two queries.
Select StoreNumber, Count(*)
From YourTable
Where InvoiceWeek = Whatever
Group By StoreNumber
Having Count(*) >= 5

Then use that query to join back to your table on StoreNumber and
output your results.

Hope that helps!
 

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