If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Filter reports
Good afternoon,
I am new to Access and have a tool that contains a report linked to a single query. The items in the data are sorted by type and by class. I only want one class to print on the report, but I want to also report to type total as a percentage of the whole. For example, if the total records are 100 and I have 10 records of type A in class B (which has 50 records), I would want the % to total to reflect 10%, not 20% If I filter using criteria in the query, I get a % to toal of 20% Any suggestions how I can only show the class that I want without sacrificing the grand total? Thanks!! |
#2
|
|||
|
|||
Filter reports
If you are only pulling numbers then try this --
SELECT [type], [class], (SELECT Count([class]) FROM YourTable) AS Total_Records, (Sum(IIF([type] = [Enter type], 1, 0)/(SELECT Count([class]) FROM YourTable)*100) AS Percent_Type FROM YourTable GROUP BY [type], [class] HAVING (((YourTable.Class)=[Enter class]) AND ((YourTable.type)=[Enter type])); -- Build a little, test a little. "Charyn" wrote: Good afternoon, I am new to Access and have a tool that contains a report linked to a single query. The items in the data are sorted by type and by class. I only want one class to print on the report, but I want to also report to type total as a percentage of the whole. For example, if the total records are 100 and I have 10 records of type A in class B (which has 50 records), I would want the % to total to reflect 10%, not 20% If I filter using criteria in the query, I get a % to toal of 20% Any suggestions how I can only show the class that I want without sacrificing the grand total? Thanks!! |
Thread Tools | |
Display Modes | |
|
|