Hello all! I have been puzzling over this for a day and a half and am getting nowhere fast. I am using Access 2003 and have a table with the following fields:
ID (autonumber)
InputDate (date/time)
Group (text)
TotalAudited (number)
Unsafe (number)
Now I want to count (not sum) the records and create a stacked column chart in a report.
I can create a query which counts the total audits:
And I get:
Group All Audits
Group 1 5
Group 2 4
Group 3 6
Group 4 3
And I can create a query that counts the audits with unsafe activities:
and I get:
Group Unsafe
Group 1 1
Group 3 2
But I want:
Group All Audits Unsafe
Group 1 5 1
Group 2 4 0
Group 3 6 2
Group 4 3 0
Can someone help me pull this together?
ID (autonumber)
InputDate (date/time)
Group (text)
TotalAudited (number)
Unsafe (number)
Now I want to count (not sum) the records and create a stacked column chart in a report.
I can create a query which counts the total audits:
Code:
SELECT SafetyGLDrivingAudittbl.Group,
Count(SafetyGLDrivingAudittbl.SGDAID) AS [AllAudits]
FROM SafetyGLDrivingAudittbl
WHERE (((SafetyGLDrivingAudittbl.InputDate) Between [Forms]![ReportFrm]![TxtStartDate] And [Forms]![ReportFrm]![TxtEndDate]));
And I get:
Group All Audits
Group 1 5
Group 2 4
Group 3 6
Group 4 3
And I can create a query that counts the audits with unsafe activities:
Code:
SELECT SafetyGLDrivingAudittbl.Group,
Count(SafetyGLDrivingAudittbl.SGDAID) AS Unsafe
FROM SafetyGLDrivingAudittbl
WHERE (((SafetyGLDrivingAudittbl.TotalUnsafe)<>0)
AND ((SafetyGLDrivingAudittbl.InputDate) Between [Forms]![ReportFrm]![TxtStartDate] And [Forms]![ReportFrm]![TxtEndDate]));
and I get:
Group Unsafe
Group 1 1
Group 3 2
But I want:
Group All Audits Unsafe
Group 1 5 1
Group 2 4 0
Group 3 6 2
Group 4 3 0
Can someone help me pull this together?