If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Summarizing quantities by Part Number
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; |
#2
|
|||
|
|||
Summarizing quantities by Part Number
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" wrote: 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; |
#3
|
|||
|
|||
Summarizing quantities by Part Number
Thanks. I'll give it a try!
"Duane Hookom" wrote: 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" wrote: 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; |
#4
|
|||
|
|||
Summarizing quantities by Part Number
On Mon, 30 Nov 2009 13:19:02 -0800, Deb wrote:
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; -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|