Count number of records for criteria for each field (1 Viewer)

cmray58

Registered User.
Local time
Today, 03:36
Joined
Mar 24, 2014
Messages
70
I'm trying to develop a query that provides a count of the number of records where a certain criteria is true for each field, individually.

I.e.,

How many records where Field 1 = Yes
How many records where Field 2 = Yes
How many records where Field 3 = No etc...

But, I don't want it to be an and or an or statement. I want to know the total number of records for each criteria above. I currently have it set up as the attached screenshot, but that of course results in an and statement.
 

Attachments

  • Capture.JPG
    Capture.JPG
    34.9 KB · Views: 118

theDBguy

I’m here to help
Staff member
Local time
Today, 03:36
Joined
Oct 29, 2018
Messages
21,358
Hi. If you want to "count" fields, you could try using the Sum() function. For example:
Code:
Sum(IIf([FieldName]=True,1,0))
Hope it helps...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 06:36
Joined
Feb 19, 2002
Messages
42,981
Or

Sum(Abs(FieldName))
 

Users who are viewing this thread

Top Bottom