Summarizing quantities by Part Number

D

Deb

This query is working, but I'd like to "summarize" the quantities by
"PartNo". How do I go about doing that?

SELECT DISTINCTROW sqry_Inventory.Program, sqry_Inventory.Division,
sqry_Inventory.PartNo, sqry_Inventory.Serial, sqry_Inventory.Building,
Sum(sqry_Inventory.[Updated Qty]) AS [Sum Of Updated Qty],
Sum(sqry_Inventory.UnitCost) AS [Sum Of UnitCost]
FROM sqry_Inventory
WHERE (((sqry_Inventory.Program)=[Enter Program]))
GROUP BY sqry_Inventory.Program, sqry_Inventory.Division,
sqry_Inventory.PartNo, sqry_Inventory.Serial, sqry_Inventory.Building
ORDER BY sqry_Inventory.Program, sqry_Inventory.Division,
sqry_Inventory.PartNo;
 
D

Duane Hookom

How about:

SELECT sqry_Inventory.PartNo,
Sum(sqry_Inventory.[Updated Qty]) AS [Sum Of Updated Qty],
Sum(sqry_Inventory.UnitCost) AS [Sum Of UnitCost]
FROM sqry_Inventory
WHERE (((sqry_Inventory.Program)=[Enter Program]))
GROUP BY sqry_Inventory.PartNo;
 
D

Deb

Thanks. I'll give it a try!

Duane Hookom said:
How about:

SELECT sqry_Inventory.PartNo,
Sum(sqry_Inventory.[Updated Qty]) AS [Sum Of Updated Qty],
Sum(sqry_Inventory.UnitCost) AS [Sum Of UnitCost]
FROM sqry_Inventory
WHERE (((sqry_Inventory.Program)=[Enter Program]))
GROUP BY sqry_Inventory.PartNo;

--
Duane Hookom
Microsoft Access MVP


Deb said:
This query is working, but I'd like to "summarize" the quantities by
"PartNo". How do I go about doing that?

SELECT DISTINCTROW sqry_Inventory.Program, sqry_Inventory.Division,
sqry_Inventory.PartNo, sqry_Inventory.Serial, sqry_Inventory.Building,
Sum(sqry_Inventory.[Updated Qty]) AS [Sum Of Updated Qty],
Sum(sqry_Inventory.UnitCost) AS [Sum Of UnitCost]
FROM sqry_Inventory
WHERE (((sqry_Inventory.Program)=[Enter Program]))
GROUP BY sqry_Inventory.Program, sqry_Inventory.Division,
sqry_Inventory.PartNo, sqry_Inventory.Serial, sqry_Inventory.Building
ORDER BY sqry_Inventory.Program, sqry_Inventory.Division,
sqry_Inventory.PartNo;
 
J

John W. Vinson

This query is working, but I'd like to "summarize" the quantities by
"PartNo". How do I go about doing that?

If you mean that you want PartNo to be the grouping level, without breaking it
down by serial or building, just don't include those fields in the query:


SELECT DISTINCTROW sqry_Inventory.Program, sqry_Inventory.Division,
sqry_Inventory.PartNo,
Sum(sqry_Inventory.[Updated Qty]) AS [Sum Of Updated Qty],
Sum(sqry_Inventory.UnitCost) AS [Sum Of UnitCost]
FROM sqry_Inventory
WHERE (((sqry_Inventory.Program)=[Enter Program]))
GROUP BY sqry_Inventory.Program, sqry_Inventory.Division,
sqry_Inventory.PartNo
ORDER BY sqry_Inventory.Program, sqry_Inventory.Division,
sqry_Inventory.PartNo;
 

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