Only count Specifc Values

S

SITCFanTN

I need to count the total number of rooms at the end of the report. I have
each room type counted already at the end of the report. I only want to
count the values of "Singles", "Doubles" and "Triples", I want to exclude the
room type "Exclude" for the total room count. Below is the code I'm using

=-Int(-Sum(Abs([RoomValue])))

I have "Singles", "Doubles" and "Triples", in the value list in the
properties section however it is still adding "Exclude" in the calculation.
Any idea how I can count just the three room types. Thank you in advance for
your assitance.
 
E

Evi

What about grouping your report by RoomType. Then you will just need the sum
in the group footer.
Or if that isn't appropriate, why not create a totals query and include that
in your report as a subreport? You could filter out Exclude in this
subreport. The advantage of this is if a new Roomtype is added, the report
would automatically reflect that without you having to edit your text box.


Evi
 
R

Rob Ward

Assuming a field called NoOfRooms that contians the number of rooms for each
line of data, then control source in the Report Footer:

=Sum(iif([Values]<>'Exclude',[NoOfRooms],0))

If there is only one room per line of data then you can change the above to:

=Sum(iif([Values]<>'Exclude',1,0))


That should do it.
 

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