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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to only sum certain rows

Status
Not open for further replies.

jello212

Technical User
Jun 19, 2007
29
US
I'm running a report off of a single view. The view contains invoices with an invoice id, and a charge amount but also contains payments with payment id's. So the data may look like

Inv Chg PmtID PmtAmt
1 1000 A 150
1 1000 B 45
1 1000 C 250
2 2000 D 600
2 2000 E 700
3 3000
etc

If I were doing a simple sum of the chg column I would end up 3000 for inv 1 and 4000 for inv 2 when, in fact, the totals are 1000 for inv 1 and 2000 for inv 2.

I've tried to do things such as combining running count and if/then (ex// if @RunningCt = 1 then Chg else 0). The if/then works as it should, but I can't sum on this new figure.

Any ideas???
 
Insert a running total that uses sum of the charge field, evaluate on change of {table.inv}, reset never. Place the running total in the report footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top