Expression in field - need if/then type phrase

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a query, I have created a field with an expression as follows:
NetActivity=[Contribution]+[Withdrawal]

I have found that some of the Contribution and/or Withdrawal fields are null
which then causes the NetActivity field to be null. Is there a way to put an
if/then statement for this field that would consider the field zero if the
Contribution or Withdrawal field are null?
 
In a query, I have created a field with an expression as follows:
NetActivity=[Contribution]+[Withdrawal]

I have found that some of the Contribution and/or Withdrawal fields are null
which then causes the NetActivity field to be null. Is there a way to put an
if/then statement for this field that would consider the field zero if the
Contribution or Withdrawal field are null?

In a Query?
In a query you do not use the = sign.
NetActivity:Nz([Contribution]) + Nz([Withdrawal])

Look up the Nz function in VBA help.
 
Fred, that information was perfect. Thanks for directing me to the correct
place. I did have : instead of = but just typed wrong when I entered my post.

fredg said:
In a query, I have created a field with an expression as follows:
NetActivity=[Contribution]+[Withdrawal]

I have found that some of the Contribution and/or Withdrawal fields are null
which then causes the NetActivity field to be null. Is there a way to put an
if/then statement for this field that would consider the field zero if the
Contribution or Withdrawal field are null?

In a Query?
In a query you do not use the = sign.
NetActivity:Nz([Contribution]) + Nz([Withdrawal])

Look up the Nz function in VBA help.
 
Back
Top