views:

90

answers:

1

Hi, i need the sum of two database fields. i use this formula field :

{dbfield1}+{dbfield2}

and if dbfield1 and dbfield2 are != from null in database the sum is showing, but if the dbfield1 or dbfield2 are missing(no data) the formula field is not showing.

how can i manage this in cr?

thank you!

+1  A: 

Two options :

Either use the Convert Database Fields to Null option under Report Options, which will convert the numeric field nulls to zero and make your sum work, or

Use the IsNull function in your formula :

If IsNull({dbfield1}) And IsNull({dbfield2}) Then
    0
Else If IsNull({dbfield1}) Then
    {dbfield2}
Else If IsNull({dbfield2}) Then
    {dbfield1}
Else
    {dbfield1}+{dbfield2}
CodeByMoonlight
Thank you so much. I tried to make something like IIF (isnull({dbfield1}) , 0, {dbfield1}) + IIF (isnull({dbfield2}),0 , {dbfield2})but did not work. thank you. it works!
andySF