SystemGroup GrandTotal and ProblemTotal = SystemGroup GrandTotal

aldeb

Registered User.
Local time
Yesterday, 23:00
Joined
Dec 23, 2004
Messages
318
Below is the code on a query that is giving me Total Faults per SystemGroup. This is working fine. I would
like to add another field to this query named Problems. After I add the new it will then show me the totals
of each problem by SystemGroup. What I want is to see the Problem Totals of each SystemGroup but I would like
also to see the GrandTotal of each SystemGroup Problems. Right now I am getting that. For Example:

**Currently**
System Group Total
Mast 133

**After I add Problem Field**
SystemGroup Problem Total
Mast Kicking 85
Mast Racking 33
Mast Chain Loose 15

The Problem Totals still equal 133 but I want the 133 to show up beside the Mast as a GrandTotal for the SystemGroup.
End results will show me all SystemGroups GrandTotal and all Problem Totals per SystemGroup. Hope this makes sense.
Bottom line is after I am able to get these totals I will be seeking a Top 5 or 10.



Code:
SELECT WorkUnitsFaultsMainTBL.SystemGroup, WorkUnitsFaultsMainTBL.FaultCategory, Count(*) AS Totals
FROM WorkUnitsFaultsMainTBL
WHERE (((WorkUnitsFaultsMainTBL.FaultCategory)<>"No Faults") AND ((WorkUnitsFaultsMainTBL.TodaysDate) Between [Forms]![Queries_ReportsFRM]![StartDateTxt] And [Forms]![Queries_ReportsFRM]![EndDateTxt]) AND ((WorkUnitsFaultsMainTBL.BuildID) In ("E010","C809","F001","C810","F187","A910","M173","M174")))
GROUP BY WorkUnitsFaultsMainTBL.SystemGroup, WorkUnitsFaultsMainTBL.FaultCategory
HAVING (((WorkUnitsFaultsMainTBL.FaultCategory) Like [forms]![Queries_ReportsFRM].[FaultCategory]))
ORDER BY Count(*) DESC;
 

Users who are viewing this thread

Back
Top Bottom