Have a numeric field, need to count records with specific entry.

J

Jose--UBOC

New to Access, I am generating a report that requires to return a count of
those records that have a specific number on a field. For example. Field
name "Number of Days", may have a numeric entry like 1, 3, or 5; need to
count those records that have either a 1, 3 or 5.

I have tried " =Count([Query]!Totals=1) "; but returns with an error.

Any assistance is greatly appreciated.
 
F

fredg

New to Access, I am generating a report that requires to return a count of
those records that have a specific number on a field. For example. Field
name "Number of Days", may have a numeric entry like 1, 3, or 5; need to
count those records that have either a 1, 3 or 5.

I have tried " =Count([Query]!Totals=1) "; but returns with an error.

Any assistance is greatly appreciated.

Use an UNBOUND control.
Not sure if you want each counted separately:
=Sum(IIf([NumberOfDays]=1,1,0))
=Sum(IIf([NumberOfDays]=3,1,0))
=Sum(IIf([NumberOfDays]=5,1,0))

or the count of all that have either 1 or 3, or 5:
=Sum(IIf([NumberOfDays] In (1,3,5),1,0))
 
Top