• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 373
  • Last Modified:

Access query that adds two columns where one is sometimes a null

I have this query:

Expr1: [TABLE]![COL1]+[TABLE]![COL2]

it's not working because sometimes either column can be a null, in that case I want it to treat the null like a 0 and add them anyways. Can I modify the query to do this?

Thanks!
0
Coaster_brook_trout
Asked:
Coaster_brook_trout
1 Solution
 
luconstaCommented:
Use the NZ function:

Expr1: NZ([TABLE]![COL1],0)+NZ([TABLE]![COL2] ,0)
0
 
Coaster_brook_troutAuthor Commented:
PERFECT, EXACTLY WHAT I WAS LOOKING FOR!!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now