Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-02-28
2
Medium Priority
?
368 Views
Last Modified: 2014-02-28
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
Comment
Question by:Coaster_brook_trout
2 Comments
 
LVL 14

Accepted Solution

by:
luconsta earned 2000 total points
ID: 39895308
Use the NZ function:

Expr1: NZ([TABLE]![COL1],0)+NZ([TABLE]![COL2] ,0)
0
 

Author Closing Comment

by:Coaster_brook_trout
ID: 39895313
PERFECT, EXACTLY WHAT I WAS LOOKING FOR!!!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question