I have successfully created a cross tab query. My problem is that I’d like the results to include column headings for all caterories, even if the cross tab query finds no items for that category.
Table 1 – ORDERS (orderID, quantity, itemID)
Table 2 – ITEMS (itemID, itemName, itemCategory)
The cross tab query I’ve created gives me total number of items BY CATEGORY, but if there are no items for a particular category, I don’t get a column heading. This makes sense to me, but the end users want the same look to the query results each time it is run.
My LONG and AWFUL workaround was to create a query for EACH category, and then one MASTER query that pulls in each of these little queries. It works.
I would prefer ONE query, that returns the sum of quanity for each itemCATEGORY. I’ve tried to use a subquery on the criteria line for each category (I repeat quantity in the query for each category, and then under criteria write a SELECT… WHERE type statement), but I either get repeated lines (Cartesian) or nothing. Or, I get an error message – “This subquery will only return ONE RECORD” (which is FINE WITH ME, but it then doesn’t display the results…)
I hope I have explained the problem clearly. THANK YOU.