Counting records from different fields

G

Guest

in the report footer i have this expression:
=IIf([Health Region]="CNAHS",Sum(Abs([Bed_Type]="Acute")),"0")
What i have are three regions and what i would like to do is count the
number of field there are within each region for a particular bed type.
The above function works fine for the health region CNAHS but for the other
two regions it returns the false argument and displays a zero. There are at
least 4 records that are associated with the other regions.

What am i doing wrong????
 
A

Allen Browne

Brett, try something like this:

=Sum(IIf(([Health Region]="CNAHS") AND ([Bed_Type]="Acute"), 1, 0))
 
G

Guest

Thankyou Allen. Works like a charm!

Allen Browne said:
Brett, try something like this:

=Sum(IIf(([Health Region]="CNAHS") AND ([Bed_Type]="Acute"), 1, 0))

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Brett said:
in the report footer i have this expression:
=IIf([Health Region]="CNAHS",Sum(Abs([Bed_Type]="Acute")),"0")
What i have are three regions and what i would like to do is count the
number of field there are within each region for a particular bed type.
The above function works fine for the health region CNAHS but for the
other
two regions it returns the false argument and displays a zero. There are
at
least 4 records that are associated with the other regions.

What am i doing wrong????
 

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

Top