Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null values in queries

Status
Not open for further replies.

penret

Technical User
Nov 14, 2003
13
US
Null Values – could someone please explain this in simple language. I have tried all ways with Nz etc but I am getting nowhere.

My Query has Column One (Total One) and Column Two (Total two), Column Two contains some null values.

I would like Column Three to total one and two and include the null records, so there are no blanks in Column Three.

Could someone please explain exactly what I need to do, in which column and line I put the expression?

I hope I am being clear.

Thanks
 
Are your fields text or numbers? Do you want to concantenate the information or add them together?
 
[tt]
What do you mean, "I have tried all ways with Nz etc". Show us the code you've put in the 'field' for which you want to change null to zero.[/tt]

[glasses][tt]Gus Brunston - Access2000(DAO Intermediate skills.
Webmaster: www.rentdex.com[/tt]
 
Thanks for responding

My fields are all numbers

I just want to add the columns together

Thanks
 
Following is the expression to put into your query where you want the sum. It is verbatim for the names you posted above, and assigns "ColumnThree" as the sum.

ColumnThree: [Total One] + nz([Total Two])

BTW, NZ indicates to replace null values with the one you specify - if no value specified, replace with zero.

HTH,
Bob
Your mileage may vary, but following the guidelines in faq181-2886 will help you reach your goal.
 
Thank you all very much for responding.

BobJacksonWcom: Your answer was exactly what I was looking for and it worked!

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top