Results 1 to 5 of 5
  1. #1
    mari_hitz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    28

    Query to perform percentage


    Hi everybody!

    I have a little issue with a query I would like to perform: I have a table with a group of people to which I should send two types of communications, there is a Column that indicates if the person should receive the first communication or the second . I have managed to make a "Count" that returns me how many persons should receive the first communications and how many the second.
    However, what I am looking for is to create a report or a table that can return me how many persons should receive the first communications and the percentage, and so on, like the table below.



    First Communications % Second Communications %
    Business travelers 3 43% 7 44%
    Complex Cases 4 57% 9 56%
    Total 7 100% 16 100%


    I have tried to obtain the percentages based on examples found in the web, however the query returns me error, and I guess it is because I do not have numbers, I have comments that should be counted. I am not looking for the exact table of above, I will be more than happy to get the percentage hehe.

    Thanks in advanced!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Don't try to calculate percentage in query. Use report Grouping & Sorting with calcs. Do a Sum calc in textbox of report header or footer and refer to that textbox for the percentage calc in the Detail section.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    mari_hitz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    28
    Quote Originally Posted by June7 View Post
    Don't try to calculate percentage in query. Use report Grouping & Sorting with calcs. Do a Sum calc in textbox of report header or footer and refer to that textbox for the percentage calc in the Detail section.
    Thanks June for your help! Sorry for my ignorance but my knowledge of Access is pretty basic. You say I should indicate in the textboxes to perform the calculations, how do I do that? I should assign a macro to it? Sorry but again my knowledge is limited.

    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Is the report RecordSource based on a GROUP BY (totals) query?

    You need the total for each First and Second. Textboxes in footer with ControlSource expressions:
    =Sum([First fieldname])
    =Sum([Second fieldname])

    Give textboxes meaningful names like, tbxFirstTot and tbxSecondTot.

    Then ControlSource expression for textboxes in Detail section:
    =[First fieldname]/tbxFirstTot
    =[Second fieldname]/tbxSecondTot

    Do you want to provide the project for analysis?

    Calculations in textboxes on reports (or on forms) is basic Access functionality and guidelines in Access Help.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529

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

Similar Threads

  1. Replies: 10
    Last Post: 07-02-2011, 11:51 AM
  2. Query to perform several special operations
    By Allison in forum Queries
    Replies: 4
    Last Post: 05-13-2011, 04:30 PM
  3. Replies: 2
    Last Post: 04-18-2011, 02:46 PM
  4. Replies: 2
    Last Post: 11-18-2009, 06:49 PM
  5. percentage in a query
    By Peljo in forum Access
    Replies: 2
    Last Post: 02-27-2008, 10:51 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