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

    Counting occurrences using a query

    I need to collect data from a table using a query. The table contains a field for the employee's name (EmployeeID) and each time they enter a call they enter their name in this field. I need to find out who enters the most calls within a given date range. All I want returned in the query is the top ten names and how many total records with their name. So Fred would have 16 records or calls, then John had 12 records........Again only need to the the top ten most calls. Below is my query so far and I am able to pull the entire list by date. I just don't know how to show only top ten and the total amount per person.



    Click image for larger version. 

Name:	topten.jpg 
Views:	8 
Size:	63.8 KB 
ID:	26446

    Thanks
    Rick

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Uncheck date range,
    click count button on menu,
    change 1 of the EMP IDs to COUNT,
    sort this count descending,
    set the query property TOP =10

  3. #3
    RickK is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    16
    I understand some of this but not all.

    Uncheck date range : I removed the check box to show that field
    click count button on menu: I assume you are referring to the Totals button which added the total row in the query.
    change 1 of the EMP IDs to COUNT: I assume you are saying select COUNT in the Total row for the EmployeeID field
    sort this count descending, : I selected descending in the sort row for the EmployeeID field.
    set the query property TOP =10: I did nothing here because I am not sure how or where to do this.

    If I did everything correct, this does not get me the results that I am after. It return all records during the date range and each record had a 1 for the count. I need it to return the persons name (employeeID) once and the amount of records during that date range for that person, then I need only the top ten.

    I am sure I am misunderstanding your instructions.

    Thanks
    Rick

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Once you have clicked on the Totals icon at the top a new row "Totals" will appear - this is where it all happens.

    WorkOrderID - this can be the Count (Count is number of records, it doesn't matter which field is used)
    EmployeeID - Group By
    Date Started - Where

    Sort Descending on the Count field
    Top 10 is set in the query's properties

  5. #5
    RickK is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    16
    Ok that looks like it worked. The only problem is I am not allowed to enter 10 as the Top values. There is a drop down list and it only allows you to pick one of the following 5,25, 100, 5%, 25%, and ALL.

    Thanks
    Rick

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

Similar Threads

  1. Counting occurrences of specific data
    By DaveC in forum Reports
    Replies: 1
    Last Post: 09-12-2016, 01:29 PM
  2. Replies: 3
    Last Post: 03-04-2016, 07:58 AM
  3. Replies: 7
    Last Post: 06-25-2015, 01:03 PM
  4. Replies: 5
    Last Post: 02-20-2014, 10:17 AM
  5. Report the number of occurrences in a field
    By ecpike in forum Reports
    Replies: 1
    Last Post: 05-05-2009, 01:57 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