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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top