I am trying to write an expression that will add two fields that sometimes can contain Null values. Retaining the 'null' aspect is important because I need to know when no data at all was recorded for a particular row.
At first I tried this code:
Expand|Select|Wrap|Line Numbers
- LY34_SUB1: Nz([LY3_TREE_SUB1],0)+Nz([LY4_TREE_SUB1],0)
So I tried adding an iif statement to my expression where if the above code was equal to 0 then the TRUE condition of the Iif statement would be a NULL and FALSE would be the sum of the two values with 0's substituted in using the Nz function.
Expand|Select|Wrap|Line Numbers
- LY34_SUB1: Iif(Nz([LY3_TREE_SUB1],0)+Nz([LY4_TREE_SUB1],0)=0),Null,Nz([LY3_TREE_SUB1],0)+Nz([LY4_TREE_SUB1],0)]
Thanks,
Gerry