Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / March 2008

Tip: Looking for answers? Try searching our database.

Only count Specifc Values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SITCFanTN - 30 Mar 2008 18:13 GMT
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.
Evi - 30 Mar 2008 18:43 GMT
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

> 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
[quoted text clipped - 7 lines]
> Any idea how I can count just the three room types.  Thank you in advance for
> your assitance.
Rob Ward - 30 Mar 2008 18:46 GMT
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.
Signature

Rob Ward

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.