Results 1 to 4 of 4
  1. #1
    jppevy is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    7

    query that generates percentages

    How do you generate a query that includes percentages? I have a table with 3 columns. There are three different types (avail, out, low) and 4 different groups (1,2,3,4) . For each group (e.g. 1), I want to find out what percentages are avail, what percentages are out, and what are low. How can i create a query for this?




    ID Type Group
    1 avail 1
    2 avail 3
    3 out
    2
    4 low 1
    5 out 4


    Thanks again!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    Options:

    1.
    build an aggregate GROUP BY (Totals) query that counts the types for each group
    build an aggregate GROUP BY (Totals) query that counts all records
    join those two queries without using a join clause, every record will have the total from the second query
    calculate percentage in the second query

    2. use DCount() expression in the first query to do the count of all records

    3. build a report using report Grouping & Sorting with aggregate calcs in group and report footers
    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
    jppevy is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    7
    Can you explain the 1st and 2nd option again in more detail. I am new to access and find it a bit unclear. Thank you for the help.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,951
    Hard to give specifics not knowing your db.

    I don't want to repeat the Access Help reference. It has guidelines on building aggregate (grouping) queries with the query designer as well as on domain aggregate functions (DSum, DCount, DLookup, etc).

    Aggregate query is basic Access functionality. Domain aggregate functions are a little more advanced tool but covered in 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.

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

Similar Threads

  1. Percentages Query
    By mabrown81 in forum Queries
    Replies: 12
    Last Post: 11-01-2012, 12:50 PM
  2. Replies: 1
    Last Post: 10-12-2012, 03:23 PM
  3. Crosstab query - adding percentages
    By bruegel in forum Queries
    Replies: 9
    Last Post: 07-31-2012, 09:50 AM
  4. Replies: 5
    Last Post: 06-13-2012, 07:43 PM
  5. Replies: 9
    Last Post: 01-27-2012, 12:52 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