Multiple counts in 1 query

  • Thread starter Thread starter Dale
  • Start date Start date
D

Dale

Access 2000

The fields that I am working with are in a
table "tblIncidents" and they are AttendantNo,
IncidentNo, and PtType. (many other fields in the table)

What I am trying to produce is a query that shows:
AttendantNo, Count of ALL IncidentNo's, Count of a
particular PtType.

My data should tell me that Attendant A has 150
IncidentNo's and 25 of those are PtType = 1

TIA
Dale
 
Use a sum of a boolean expression.

SELECT AttendantNo,
Count(IncidentNo) as IncidentCount,
Abs(Sum(PtType=1)) as CountPtType1
FROM TblIncidents
GROUP BY AttendantNo
 
Back
Top