Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Totaling Certain Items at Bottom of Report 1

Status
Not open for further replies.

ajhts

Technical User
May 1, 2001
84
US
I have a report that prints patients and looks like this:

Charge Item
Date Number Item Description Payor Units


11/07/03 50 Debility A 10
11/10/03 50 Debility B 10

On my grand total section, I know how to add everything up, but my problem is I would like to show grand totals for all of the Payor A's, Payor B's seperate. I put an IIF statement in on my report footer, but it only reads the very last line, which in the above example would be B. Then it totals all of the units just fine but it places them next to B. Here is the example IIF that I used.
Part A units =IIF([Payor]="A",Sum([Units]),"0")
Part B units =IIF([Payor]="B",Sum([Units]),"0")

Thank you for your time!

AJ
 
Hi
=Sum(IIf([PAYOR]="A",[UNITS],0))
in the report footer
 
Hello,

Do you have grouping bands on the Payor details? If so, just add a footer and use =Sum(Units) on that?
This would also be the easiest to do if there are type of payors in addition to A and B.

If they are mixed together, then I would do the following:

In the footer use DSum:
=DSum("Units", "Table, query or SQL statement the report is based on", "Where condition matching one the report loaded up with AND Payor='A'") etc

and a similar one for B.

John
 
SuicidED

Thank you very much, I tried the first suggestion and it worked perfect.

Thanks to everyone, this is a great website!

AJ
 
An alternative would be to create a subreport based on a totals query that groups by Payor. SuicidED's solution is great and is very efficient. The possible issue with this is that if you add another Payor type value (for example"X") then you will need to add another text box and calculation to the report footer.

If you use a subreport, this will be self-maintaining.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Thanks again, you guys are great.

AJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top