Counting more than one type of entry in same string

P

pompeyboyUSA

I am trying to count more than one type of entry to be entered into a text box.

For example I need to have a total of all types of Officers (Lt Col, Maj,
Capt, Lt) in one text box and a total count of Other Ranks in a seperate text
box

I can count one type using a text box in the Report Header containig
=Sum(Abs([HeldRank]="Capt")) but I can't seem to work out how to have them
all add up in one string.

Is there also a way to add the two text boxes together once you have the
subtotals

Thank you for your help

Charlie
 
K

Ken Snell \(MVP\)

You can string together the different tests:

=Sum(Abs([HeldRank]="Capt" OR [HeldRank]="Lt Col" OR [HeldRank]="Maj"
OR [HeldRank]="Lt")))

And, for the other sum:

=Sum(Abs([HeldRank]<>"Capt" AND [HeldRank]<>"Lt Col" AND [HeldRank]<>"Maj"
AND [HeldRank]<>"Lt")))
 
P

pompeyboyUSA

Ken,

Superb, thank you very much, works a treat.



Ken Snell (MVP) said:
You can string together the different tests:

=Sum(Abs([HeldRank]="Capt" OR [HeldRank]="Lt Col" OR [HeldRank]="Maj"
OR [HeldRank]="Lt")))

And, for the other sum:

=Sum(Abs([HeldRank]<>"Capt" AND [HeldRank]<>"Lt Col" AND [HeldRank]<>"Maj"
AND [HeldRank]<>"Lt")))

--

Ken Snell
<MS ACCESS MVP>


pompeyboyUSA said:
I am trying to count more than one type of entry to be entered into a text
box.

For example I need to have a total of all types of Officers (Lt Col, Maj,
Capt, Lt) in one text box and a total count of Other Ranks in a seperate
text
box

I can count one type using a text box in the Report Header containig
=Sum(Abs([HeldRank]="Capt")) but I can't seem to work out how to have them
all add up in one string.

Is there also a way to add the two text boxes together once you have the
subtotals

Thank you for your help

Charlie
 

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