Solved

I have a join Query that Returns Nulls. Is There a Way to Make it Return Zeroes instead of Nulls?

Posted on 2011-09-09
4
251 Views
Last Modified: 2012-05-12
I have a join query that returns nulls. (Code posted below)

I would like the nulls to show as zeroes instead of just empty values.

The QPR_Intersuhl_QNs_tbl is the table with the gaps that show up as nulls. I would like the Total_QMs field to return a zero if the value for that field is a null.
SELECT QPR_Interstuhl_QNs_tbl.WeekEndingDate, QPR_Interstuhl_QNs_tbl.Total_QNs, Possible_Week_Ending_Dates_Tbl.PossibleWeekEndingDates
FROM QPR_Interstuhl_QNs_tbl RIGHT JOIN Possible_Week_Ending_Dates_Tbl ON QPR_Interstuhl_QNs_tbl.WeekEndingDate = Possible_Week_Ending_Dates_Tbl.PossibleWeekEndingDates;

Open in new window

0
Comment
Question by:Rex85
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 36513042
Wrap those other fields in the NZ() function.

SELECT NZ(QPR_Interstuhl_QNs_tbl.WeekEndingDate, 0), NZ(QPR_Interstuhl_QNs_tbl.Total_QNs, 0)

Although I'm not sure why you would want to display a zero for a blank date field.
0
 

Author Comment

by:Rex85
ID: 36513058
It's the one field ... Total QNs that needs to be a zero. It is essentially a count of complaints
0
 

Author Closing Comment

by:Rex85
ID: 36513069
that did it. thanks again! (I only used it on the one field.)
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 36513071
as recommended, use the NZ() function.  NZ stands for NullToZero.  By default it is supposed to return a zero if you don't pass it the optional value, but I generally provide it the 0 anyway.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

749 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