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

Running total output zero and cannot sum RT 1

Status
Not open for further replies.

gyfu

Programmer
May 28, 2001
77
HK
I have 2 problems here but are somehow related in CR9.

1) How do I set my running total field to display zero, if it did not total up any values?

2)In a formula, I have {#RT1} + {#RT2}. However, if either one of this field's value is null, my formula result will be null as well. How do I get it to ignore the null and make it zero instead.

This is what I try to go around but still didn't work.
NUMBERVAR A:=IF ISNULL({#RT1}) THEN A:=0;
NUMBERVAR B:=IF ISNULL({#RT2}) THEN B:=0;

A+B;

With this, I would get a value of zero.

Please advise. Thanks.



-- gyfu --
 
Try:

NUMBERVAR A:=IF ISNULL({#RT1}) THEN A:=0 else A := {#RT1};
NUMBERVAR B:=IF ISNULL({#RT2}) THEN B:=0 else B := {#RT2};
A+B;

-LB
 
DUH!!I should have figured that one what. Thanks LB.

How about the first issue? How can I display zero if null in a running total field?

thanks again

-- gyfu --
 
Use formulas like:

If Isnull({#RT1}) then 0 else {#RT1}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top