Filter reports

C

Charyn

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!!
 
K

KARL DEWEY

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]));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top