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

Crosstab and null fields

Status
Not open for further replies.

rlals

Programmer
Jun 23, 2003
29

I´m using CR9

I have a Formula field in my Crosstab report.
This formula look like this:
Formula = {order.value1} + {order.value2}

But this just works when value1 and value2 are not null. This return 0 (zero) when value1 OR value2 is equal to null.

Someone can help me ?

Thanks.

Ricardo:Amaral

 
You can convert nulls to default values automatically using a setting on Tools>Options.

If you don't want to do that then I think you will have to test for null and use variables to do the calculation.

numbervar a;
numbervar b;

if isnull( {order.value1} ) then
a:= 0
else
a:= {order.value1};
if isnull( {order.value2} ) then
b:= 0
else
b:= {order.value2};
a + b

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top