Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using COUNT in Report

Status
Not open for further replies.

cutestuff

Technical User
Sep 7, 2006
162
CA
hi,

I have a column in my query called "Status".
I have a report based on this query and in the report footer I have an unbound textbox with the following control source:
=Count(IIf([Status]="A",0)).
The "Status" field contains 3 values - A, B and X.
I need to add up the total A's, total B's, total X's. However, my formula doesn't seem to work. It keeps giving me the value "0".

Help! please!

Thank you in advance..
 
Count() will count all non-null values so whether you cound 1s or 0s won't make any difference. You should use something like:
=Sum(Abs([Status]="A"))
=Sum(Abs([Status]="B"))
=Sum(Abs([Status]="X"))

I would probably recommend a small subreport based on a totals query. This would more easily allow for addtional status values if "N" is added as a status option.





Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top