Results 1 to 3 of 3
  1. #1
    trussell is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2021
    Posts
    5

    Query to Group by Case Category and Count Number of Cases "Approved" and "Denied"

    Hi Everyone,



    I am having some trouble with this query:

    I have a table which holds information about legal cases which have applied for financial aid. In this table there is a field for the case category (fraud, tort, etc.) and a field for whether or not the case got approved for financial aid (approved or denied).

    I want to design a query that is grouped by case category. Then, I want to count the number of cases in that category which were approved, and I want to count the number of cases in that category which were denied.

    If anyone knows how to do this, I would greatly appreciate it. Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    make a query, Q1, to pull the said data with the criteria,
    then in a report you can count in the footer of the catagory,

    or make another query to do the counts using Q1,

    or use the function DCount on Q1: Dcount("*","Q1","[catagory]='Fraud'")

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    create an aggregate query, grouping on category and summing the following

    approved:-sum(myfield=true)
    denied:-sum(myfield=false)

    where myfield is the one you describe as 'a field for whether or not the case got approved '

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 04-08-2021, 09:15 AM
  2. Replies: 5
    Last Post: 05-14-2019, 07:48 AM
  3. Replies: 2
    Last Post: 01-23-2017, 07:06 PM
  4. Replies: 4
    Last Post: 12-20-2015, 12:16 PM
  5. Replies: 1
    Last Post: 09-07-2015, 08:00 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums