Qry to sum multiple records into 1 output

Guitarcam87

Registered User.
Local time
Today, 16:05
Joined
Jan 17, 2013
Messages
24
Thanks in advance!!!!

Here is what I have:

tblOrders
[Press][Shift][TotParts]

Example:

[Press1][A][5000]
[Press1][3000]
[Press2][A][2000]
[Press3][A][4000]
[Press3][3000]

Here is what I need:

A query that will return the total produced between the shifts by press...

Example:

[Press1][8000]
[Press2][2000]
[Press3][7000]

I really don't know where to begin to get this type of calculation whether it be in design or SQL. :confused: Ultimately I need sort of a summary of total parts with each press only listed once. Thank you for your help in advance. I don't know what I would do without this forum!!!:p
 
You need to sum the TotParts by Press. Go to Create query. Add the table. Once the table is shown on the top, drag down the fields Press and TotParts. On the row for Criteria, located on the left, under TotParts, click the summation symbol. That will add a new row called Total and you will see "Group By" that has been inserted. Under TotParts, change Group By to Sum, a dropdown list will appear. Run the query and that is all. You can group by as many fields as you want. Just add more fields to your query and include Group By for each one.
 
Create a Total Query with the following SQL:

Code:
SELECT tblOrders.Press, Sum(tblOrders.TotParts) AS SumOfTotParts
FROM tblOrders
GROUP BY tblOrders.Press;
 

Users who are viewing this thread

Back
Top Bottom