Results 1 to 4 of 4
  1. #1
    sai_rlaf is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    44

    Creating a percentage of total records report

    I have a table with four distinct values. What I would like to do is create a report that takes the total of each value and returns the percentage of the total records in my table/query.

    When I create it now, all of my percentages are returned as 100% instead of what I want.



    Any thoughts on what is needed to correct?

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you're doing it row by row you'd have to do something like

    [item1]/([item1] + [item2] + [item3] + [item4])

    So if you had four items

    2,3,4,5 and you added my percentage calculation you'd end up with a row that looked like

    2,3,4,5,.1428,.2142,.2857,.3571

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This type of thing should work:

    SELECT CAR_RECORDS.Company_no, Count(CAR_RECORDS.car_no) AS CarCount, Round(Count([car_no])/DCount("*","car_records"),2) AS PercentOfTotal
    FROM CAR_RECORDS
    GROUP BY CAR_RECORDS.Company_no;
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you're creating a report you do not need to calculate the percentage in your query. Stay away from d functions in queries if you can help it (no offense pbaldy) On your report just sum the fields you're interested in, let's say in your group or report footer you have the formula =sum(item1) and text box with this formula is called Item1Total. Now if you want to find the percentage of item1 that came from each row of your data you could have another unbound text box in the DETAIL section of your report with the formula

    =[item1]/[Item1Total] and your percentage should be displayed.

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

Similar Threads

  1. stuck on expression for total query records
    By pacer31 in forum Queries
    Replies: 3
    Last Post: 07-04-2011, 11:30 AM
  2. Creating a Daily Running Total Query
    By seraph in forum Queries
    Replies: 0
    Last Post: 08-15-2009, 12:11 AM
  3. Use report to Calculate sum and percentage
    By bangemd in forum Reports
    Replies: 3
    Last Post: 05-28-2009, 12:01 PM
  4. Total records printed
    By LesleyA in forum Queries
    Replies: 3
    Last Post: 08-04-2008, 03:53 AM
  5. Replies: 1
    Last Post: 12-06-2006, 05:32 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