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!

Getting 24 seperate "count" queries on 1 report

Status
Not open for further replies.

clickster

MIS
Feb 19, 2002
89
0
0
US
I have 24 seperate "count" queries totalling different thing in different ways. They all run off of the same table. There is no way to consolidate the queries into one, or even a few. How can I get these all onto one report?

A little background info:
this is a shipping database. We have 2 people we ship to and about 12 items that we ship to each of them. I need my report to have 2 sections: CustomerA and CustomerB.
Under CustomerA, I want a text box to display the total number of Item 1 that was shipped to them, another with the total number of item 2, etc. Then an identical section from CustomerB with the items that were shipped to them. The items are identical and always the same 12 items.
 
I forgot to mention how the items are stored in the records. Each time an item is shipped, there is a single field called "ITEM" that list the item shipped. They choose this from a drop down on a form. This is why 24 seperate queries are necessary. I have to have a query that pulls CustomerA Item1 total, CustomerA Item2 total, CutomerA Item3 total, etc. then do the same with CutomerB
 
Why doesn't this work?

Code:
select customer, item, sum(qty_shipped)
from mytable
where ...
group by customer, item;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top