Solved

Access aggregate query show total for each possible result

Posted on 2012-04-05
2
372 Views
Last Modified: 2012-06-21
Hi! I'm trying to put together an aggregate query in Access. The purpose of the query is to count records in a table based on a criteria. However, I want the query to show the total records where a certain field is true, and the total where it is false. I want these to show up as two separate columns in the query. However, when I include both criteria and run the query, I get no results. How can I fix this?
screenshot
0
Comment
Question by:etech0
[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 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 37811847
SELECT Copywriter, CatYear, Sum(IIF([Cat Recd] = True, 1, 0)) as [Yes], Sum(IIF([CatRecd] = False, 1, 0)) as [No]
FROM [CatWeb Work]
WHERE CatYear = 2013
GROUP BY CopyWriter, CatYear
0
 
LVL 10

Author Closing Comment

by:etech0
ID: 37812480
Thanks!
Quick and easy response.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

726 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