Compound Count Problem

  • Thread starter Thread starter Paul Axelrod
  • Start date Start date
P

Paul Axelrod

In one of the tables in my database, I have fields PJIDNo Whse1
Whse2 Whse3
The three Whse fields store one character values a, b, c, d,
........
To count the number of occurances of b in field whse1, I place the
following formula into a control on a Form or Report:
=sum(iif([whse1]=b,1,0)) This returns the number of occurances of b
in field whse1
The question is, how can I calculate the number of occurance of the
three whse fields, within one control.
Many thanks
Paul
 
Your expression won't work without quotes around b. Are you looking for
something like:
=sum(Abs([whse1]="b") + Abs([whse2]="b" + Abs([whse3]="b"))
 
The lack of quotes was an oversite in presenting my question.
My thanks for the expression, it does exactly what I need to accomplish.

Regards
Paul


Duane Hookom said:
Your expression won't work without quotes around b. Are you looking for
something like:
=sum(Abs([whse1]="b") + Abs([whse2]="b" + Abs([whse3]="b"))

--
Duane Hookom
MS Access MVP


Paul Axelrod said:
In one of the tables in my database, I have fields PJIDNo Whse1
Whse2 Whse3
The three Whse fields store one character values a, b, c, d,
.......
To count the number of occurances of b in field whse1, I place the
following formula into a control on a Form or Report:
=sum(iif([whse1]=b,1,0)) This returns the number of occurances of b
in field whse1
The question is, how can I calculate the number of occurance of the
three whse fields, within one control.
Many thanks
Paul
 
Back
Top