Totals for records with same order #

J

James D. Houston

I work for a small mail order company and I'm trying to get a estimate of
our shipping costs. If we get a order for 6 items and we only have 4 in
stock, we will ship the 4 and backorder the other 2. The table structure
looks like this: Order#, Weight, ShipDate, Cost. I need a query that will
tell me the total shippng cost for each order. I other words, if we have
two shipments for Order# 40314 and the first shipment cost 6.95 and the
second cost 5.95 I want a query where the results look like this:
Order # Cost
40314 12.90

Thanks in advance

Jim
 
C

Chris2

James D. Houston said:
I work for a small mail order company and I'm trying to get a estimate of
our shipping costs. If we get a order for 6 items and we only have 4 in
stock, we will ship the 4 and backorder the other 2. The table structure
looks like this: Order#, Weight, ShipDate, Cost. I need a query that will
tell me the total shippng cost for each order. I other words, if we have
two shipments for Order# 40314 and the first shipment cost 6.95 and the
second cost 5.95 I want a query where the results look like this:
Order # Cost
40314 12.90

Thanks in advance

Jim

Jim,

SELECT YT1.[Order#]
,SUM(YT1.Cost)
FROM YourTable AS YT1
GROUP BY YT1.[Order#]


Sincerely,

Chris O.
 

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