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

Sum formula in if Then statement

Status
Not open for further replies.

donnarenia

Technical User
May 28, 2010
41
US
What is wrong with this variable formula? I need to pull out all adjustment amount from one table and have them show as well as all Final Bill Amounts. If it is an adjustment amount I need it to show as a negative.

WhilePrintingRecords;
currencyVar adjustment;
currencyVar InvoiceAmt;

adjustment :={CASH.Type}="A" , {CASH.Amount};
invoiceAmt :={AR.Type} ="P", {AR.FinalBillAmt};

Can someone help....PLEASE
 
//{@Formula}
currencyvar adjustment;
currencyvar invoiceAmt;
if {CASH.Type}="A" then adjustment := {CASH.Amount}*(-1) else 0;
if {AR.Type}="P" then invoiceAmt := {AR.FinalBillAmt} else 0;

adjustment &" "&invoiceAmt


I am not sure how you want to display the resulting information. The above does the logic, then simple displays the 2 values separated by spaces.

It may be easier to create 2 formulas, one for adjustment and one for invoiceAmt if you have other calculations to perform.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top