A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filter reports



 
 
Thread Tools Display Modes
  #1  
Old September 24th, 2009, 09:35 PM posted to microsoft.public.access.gettingstarted
Charyn
external usenet poster
 
Posts: 2
Default 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  
Old September 24th, 2009, 10:56 PM posted to microsoft.public.access.gettingstarted
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:17 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.