Solved

Access aggregate query show total for each possible result

Posted on 2012-04-05
2
370 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
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…

831 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