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

sum formula result blank 1

Status
Not open for further replies.

azoe

Technical User
Feb 21, 2005
175
US
I have tried the formula below with and without the WhilePrintingRecords and the result is the same.
Example: Payment is null and Adjustment is 138.00. Instead of getting a total of 138.00 I am getting 0.

I want get a total of both fields for the enc_nbr group. From reading the other posts I thought it would work if I checked for Null.

Thank you -


whilePrintingRecords;

if isnull({aa_dch_BFAdjustments;1.paid_amt})
then 0
else (sum({aa_dch_BFAdjustments;1.paid_amt}, {aa_dch_BFAdjustments;1.enc_nbr}))

+

if isnull({aa_dch_BFAdjustments;1.adj_amt})
then 0
else (sum({aa_dch_BFAdjustments;1.adj_amt}, {aa_dch_BFAdjustments;1.enc_nbr}))
 
Try replacing the paid field and the adjustments field with a formula that checks for nulls. Like:

//{@paid}:
if isnull({aa_dch_BFAdjustments;1.paid_amt})
then 0 else
{aa_dch_BFAdjustments;1.paid_amt}

//{@adj}:
if isnull({aa_dch_BFAdjustments;1.adj_amt})
then 0
else {aa_dch_BFAdjustments;1.adj_amt}

Then you can write a formula:

sum({@paid},{aa_dch_BFAdjustments;1.enc_nbr}) +
sum({@adj},{aa_dch_BFAdjustments;1.enc_nbr})

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top