A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Summarizing quantities by Part Number



 
 
Thread Tools Display Modes
  #1  
Old November 30th, 2009, 09:19 PM posted to microsoft.public.access.queries
deb
external usenet poster
 
Posts: 898
Default 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  
Old November 30th, 2009, 10:43 PM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default 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  
Old November 30th, 2009, 10:48 PM posted to microsoft.public.access.queries
deb
external usenet poster
 
Posts: 898
Default 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  
Old December 1st, 2009, 12:37 AM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.