Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:01:14+00:00 2026-06-12T09:01:14+00:00

It seems that we can not use Count (Distinct column) function in MS Access.

  • 0

It seems that we can not use Count (Distinct column) function in MS Access. I have following data and expected result as shown below

Looking for MS Access query which can give required result.

Data

ID     Name     Category    Person  Office
1      FIL       Global     Ben     london
1      FIL       Global     Ben     london
1      FIL       Overall    Ben     Americas
106   Asset      Global     Ben     london
156   ICICI      Overall    Rimmer  london
156   ICICI      Overall    Rimmer  london
188   UBS       Overall     Rimmer  london
9    Fund      Global       Rimmer  london

Expected Result

Person  Global_Cnt  Overall_Cnt    
Ben          2         1
Rimmer       1         2
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:01:15+00:00Added an answer on June 12, 2026 at 9:01 am

    Use a subquery to select the distinct values from your table.

    In the parent query, GROUP BY Person, and use separate Count() expressions for each category. Count() only counts non-Null values, so use IIf() to return 1 for the category of interest and Null otherwise.

    SELECT
        sub.Person,
        Count(IIf(Category = 'Global', 1, Null)) AS Global_Cnt,
        Count(IIf(Category = 'Overall', 1, Null)) AS Overall_Cnt
    FROM
        (
            SELECT DISTINCT ID, Category, Person
            FROM YourTable
        ) AS sub
    GROUP BY sub.Person;
    

    I was unsure which fields identify your unique values, so chose ID, Category, and Person. The result set from the query matches what you asked for; change the SELECT DISTINCT field list if it doesn’t fit with your actual data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that Visual Basic can not reference sheets according to user-modified sheet names.
It seems that i cannot access $(this) inside jquery ajax success function. please see
It seems that we can show layers and even use a different zPosition for
I am using java playframework2 and it seems that I can not get the
I have a global object MyFruits that can have multiple properties. At a minimum,
i have a query that goes like this: $get_feed_amount = mysql_query( SELECT COUNT(*) as
It seems that i cannot call focus() on a textarea of my chrome extensions
How ASP.NET compiles its assemblies generally confuses me. It seems that I cannot program
It seems that a constructor that takes a non-const reference to an istream cannot
I have a relatively simple question that I cannot seem to find the answer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.