View Full Version : Query 3 tables - Sum quantities and return range of prices


sjk1000
11-06-2008, 12:12 AM
Hi All
I need 2 queries from the attached db tables to get info for product models - the first one should return the sum of the quantities for a particular product model and the second should return the minimum and maximum product_price for that model.

I've figured out the long way round to get the summed product quantities involving 4 queries - a union query to bring the tables together, a make table query that changes the output into a table, a query that then removes the duplicate records and sums the product quantities, and finally, the query which gives gives the quantity of the product i'm interested in. Phew! I dreamt about tables last night rrrrr : )

Any help simplifying this lot would be very much appreciated
Thank you!
Steve

sjk1000
11-06-2008, 06:08 AM
I know somebody is keen to answer this before it slips down the page and out of sight.....
: )

neileg
11-06-2008, 08:04 AM
Your structure is wrong. You only need one table, not three. The one table will be in effect the same as the output of your union query.