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

test

Status
Not open for further replies.

ianus

MIS
Nov 13, 2001
6
ES
can't post large messages, i'll try a short one
 
I have done a report in which I linked OE history detail (I need to report payments by item category) to AR receipt.
There are invoices that do not have a payment attached and also because an invoice has more than one detail line I want the payment amount to be added into an accumulator only once per invoice.
Here is the formula I used.
NumberVar Runtotal;
-Runtotal:=Runtotal+tonumber(if isnull({AROBP.AMTPAYMHC}) then 0 else {AROBP.AMTPAYMHC}*if ( recordnumber=1 or Previous ({OESHDT.TRANNUM}) <>{OESHDT.TRANNUM}) then 1 else 0)
If I place the field in the detail section of the report, the very last detail reports a correct running total.
My problem is that I will have to hide the detail of the report (since I want to use it as a sub-report and the client is interested only in the receipt total).
If I copy and paste the formula field in the report's footer the running total seems to be incorrect, specifically the amount field of the very last record gets added to the running total twice. How can I fix this issue?
 
Also I tried a different approach:
I created a field that is 1 if the record detail is the first one (or the only one)in an invoice and zero otherwise. I multiply this field with the receipts amount and I get a new formula field that is equal to the receipt amount for every first detail in the invoice and zero otherwise. Now I would simply want to to a sum for the whole report. The proble is that the sum button it is not available (it is greyed out). The field is definitely numeric.What is the problem in this case?
Thank you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top