Avatar of Chadd C
Chadd C
 asked on

How can I include NULL records in my query?

I have two tables:

Loaded Questions: contains all the questions in my survey (as well as targeted sample size). Structure is:
Question_ID (unique/primary key)
Issue (serves as the category)
Question (the question)
Sample_Size (total number of responses we need for that particular question)

cs13_qc: contains all the responses
Question  (unique/primary key associated with Question_ID for the question (In Loaded Questions).
Response (response)


What I am attempting to accomplish is a query that will list ALL the questions loaded in the "Loaded Questions" table and their targeted sample size, a [count] of associated responses to each question listed in the cs13_qc table, and a calculation of the difference [status].  Here is my code thus far:

SELECT [Loaded Questions].Question_ID, [Loaded Questions].Issue, [Loaded Questions].Question, [Loaded Questions].Sample_Size, Count(cs13_qc.Question) AS [Count], [Count]-[Sample_Size] AS Status
FROM [Loaded Questions] INNER JOIN cs13_qc ON [Loaded Questions].Question_ID = cs13_qc.Question
GROUP BY [Loaded Questions].Question_ID, [Loaded Questions].Issue, [Loaded Questions].Question, [Loaded Questions].Sample_Size, [Count]-[Sample_Size];

Open in new window


All seems to work expect that the query only lists those questions that have received a response. Those questions that have no response are not appearing in the query. How do I fix it so that they appear with a value of "0"?
Microsoft Access

Avatar of undefined
Last Comment
Scott McDaniel (EE MVE )

8/22/2022 - Mon
SOLUTION
Shaun Kline

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Scott McDaniel (EE MVE )

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.
fblack61