Question:
How do you include Records in a Microsoft Access Query if the record has no data?
2012-03-16 11:49:13 UTC
That title is probably incredibly confusing, so allow me to elaborate here. I am doing a project that involves Microsoft Access. I have to record information about Television shows. I am making a query that requires me to show 6 different genres, the number of shows that fall into those genres and the total number of viewers. Everything is going fine except for the fact that I am required to show all 6 queries, even if they have no shows. When I run the query I only get 4 genres back, because 2 of them have no shows. How can I run the query so that the 2 genres with no shows in the database show up?

Below is the query instructions...

"Create a query that lists each genre name, the number of shows within that genre, and the total number of viewers for that genre. Your results must include all genres, even if they have no shows. Sort by the total number of viewers in descending order."
Three answers:
Cyrus
2012-03-19 06:02:12 UTC
You're getting 4 records because you're doing an inner join. Inner-joins require the data on both sides of the join to exist. What you need is an outer join, specifically favoring to show all genres, and as many matching shows that exist.



If you need help implementing this, visit us at http://acsdb.com
?
2016-10-21 15:59:48 UTC
hi, you are able to opt to make clean slightly. Which of those sounds more advantageous like your problem: a million) the kind's list source is a table, and the priority is that you're unable to CREATE a clean list making use of the kind except you enter files into each and each of the kind fields. 2) the kind's list source is a question that retrieves files from a table (or tables), and the priority is that the question isn't getting each and each of the information that you want -- so as that once you open the kind not each and each of the information are there.
Jon Gould
2012-03-16 12:00:14 UTC
Sounds like ur using some criteria in the query to eliminate those with no shows. without any selection criteria you should see all items, empty or not.



next time include the query sql, it helps when trying to answer


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...