Results 1 to 5 of 5
  1. #1
    osibindlana is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    2

    Count the number of times a value appears in a column using Ms Access

    I would like to count the number of times a value appears in a column using Ms Access

    eg.


    Name Count
    Mike 2
    Paul 1
    Mike 2
    Peter 1


  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You can use an Aggregate Query to do so, but note that it then only list each option once (so if the name "Mike" appears twice in your list, the results of the Aggregate Query will list the name "Mike" once with a count of 2 next to it). Not sure if that is acceptable to you.

    To do this, simply create a new query, and add the Name field to your query twice. Then click on the Totals (Aggregate) button (it looks like a Sigma). This will add a Totals row under both of your fields in the Query Builder. Leave the first field as "Group By" on the Totals row, but change the second one to "Count". This will give you the count of each name.

    If you really want to list out each name multiple times, you can simply then create a second query, that joins your first query with your original data table on the Name field, and then return your Name, Count, and whatever other fields you would like.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    in query design, bring down NAME field twice.
    turn on summation icon
    change the rightmost NAME , on the TOTAL line, to COUNT

  4. #4
    osibindlana is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2014
    Posts
    2
    Hi Guys, I seem to be missing this

  5. #5
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Hi Guys, I seem to be missing this
    Missing what, exactly?

    See if this helps clarify what we are telling you to do: https://support.office.com/en-us/art...7-e1024ccfcca8

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

Similar Threads

  1. Replies: 7
    Last Post: 07-31-2014, 05:14 PM
  2. Replies: 3
    Last Post: 06-10-2014, 11:50 AM
  3. Replies: 14
    Last Post: 02-23-2012, 06:32 PM
  4. Count How Many times a value appears in a table
    By younggunnaz69 in forum Queries
    Replies: 1
    Last Post: 10-19-2011, 10:29 PM
  5. Replies: 3
    Last Post: 08-24-2010, 07:40 PM

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