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

Summing (Null values)

Status
Not open for further replies.

Senseial

Programmer
Feb 11, 2004
40
CA
Hello ALl

I have a problem with summing two fields in the formula.
But the problem is one or the other fields can be NULL. I am checking for null and I use IIF to see it it is than 0 else put the field value. Than I sum the two and I get no result. What am I doing wrong.

1.
IIF (IsNull({v_rep_inv_req_sku.QUANTITY_GOOD}),0,{v_rep_inv_req_sku.QUANTITY_GOOD})

2.
IIF (IsNUll({v_rep_inv_req_sku.QUANTITY_DAMAGED}),0,{v_rep_inv_req_sku.QUANTITY_DAMAGED})

and than var1 + var2


Thanks a lot
 
Try:

@Formula1
IF IsNull({v_rep_inv_req_sku.QUANTITY_GOOD}) then
0
else
{v_rep_inv_req_sku.QUANTITY_GOOD}

@Formula2
IF IsNUll({v_rep_inv_req_sku.QUANTITY_DAMAGED}) then
0
else
{v_rep_inv_req_sku.QUANTITY_DAMAGED}

@formula3
{@formula1}+{@formula2}

-k
 
Thank. I did that the minute I posted my question. Not sure why IIF does not work and IF works.
Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top