Solved

Access aggregate query show total for each possible result

Posted on 2012-04-05
2
368 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
2 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
Comment Utility
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
Comment Utility
Thanks!
Quick and easy response.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now