Results 1 to 5 of 5
  1. #1
    O.92 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    3

    Percentage of Total

    I have data for employee's as such:

    Recruiter........Employee ID............Employee Status
    Steven..........643983489..............ACTIVE


    Hailey...........643983578..............LEAVE OF ABSENCE
    Steven..........643983834..............ACTIVE
    Steven..........643983001..............TERMINATED
    Steven..........643983283..............ACTIVE
    Hailey...........643983542..............ACTIVE
    Steven..........643983111..............LEAVE OF ABSENCE
    Hailey...........643983782..............ACTIVE

    I am trying to build a query that calculates the percentage of total that is Active or Leave of Absence by each recruiter. Is there a way to do this, or a workaround using multiple queries? I appreciate any help!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Have you tried creating a totals query? I would start there. You can use the Totals query tool in the Query Designer and then select the Sum() function from the appropriate field within the Grid at the bottom of the Query Designer.

  3. #3
    O.92 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    3
    I'm not sure that would work? Can you sum non-numerical values?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by O.92 View Post
    I'm not sure that would work? Can you sum non-numerical values?
    No, you can some their count. And actually, for averages, you will need a Count. I got my functions mixed up. Start with getting a count and then you can use the Count for your Avg() function.

    In the end, you will probably end up with something like this.
    Avg(Count(MyFieldName))

    So start with design view and use the Totals button at the top, within the ribbon. Add the Count function. Switch to SQL view and wrap that function with the Avg() function.

  5. #5
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    Quote Originally Posted by O.92 View Post
    I'm not sure that would work? Can you sum non-numerical values?
    You can interpret the non-numerical values and then use the numbers. Give this a try:

    Code:
    SELECT RECRUITER, sum(IIF([Employee Status]="ACTIVE",1,0))/count(*) Active_Percentage, sum(IIF([Employee Status]="LEAVE OF ABSENCE",1,0))/count(*) Leave_Percentage
    FROM tblName
    GROUP BY RECRUITER
    Replace tblName as appropriate.

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

Similar Threads

  1. How to get Total Sum to percentage%
    By Kitz14 in forum Queries
    Replies: 1
    Last Post: 07-15-2015, 11:02 PM
  2. Replies: 3
    Last Post: 01-18-2015, 06:05 PM
  3. Replies: 6
    Last Post: 02-23-2014, 03:54 PM
  4. Replies: 28
    Last Post: 03-13-2012, 07:48 AM
  5. Creating a percentage of total records report
    By sai_rlaf in forum Reports
    Replies: 3
    Last Post: 08-12-2011, 11:39 AM

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