View Full Version : report filter


NickNeville
10-24-2010, 10:20 PM
Good morning all
I wonder if anyone could tell me if it is possible to filter out the number of lines in a list please. Basically I have E.g.50 results of a competition but I only want to show the top 6 of each class. Is it poss to only show these 6 top scores ?
Like Class AA (top 6 scores)
Class A (top 6 scores)
Class b etc
many thanks
Nick

Trevor G
10-25-2010, 01:37 AM
You could look at adjusting the source if it is a query as you can select to show the top 6 there.

Open the query in design view then in the top part of the query use the right mouse button and select properties you should see a top value you can then set this to show top 6.

NickNeville
10-25-2010, 02:12 AM
Many thanks Trevor that works a treat.
May I ask whilst on the subject. My report shows the classes of the competition as
A, AA, B, C, I guess due to the alpha numeric set up. I just wondered if there was any way to show the AA class first. Or shall I post a new thread?
thanks again for your help
Rgds
Nick

Trevor G
10-25-2010, 05:48 AM
Nick,

In the query create an IIF statement which will assign a number to the data in the order that you want then just sort based on the IIF statement, something like this

SortExpr:IIF([FieldName]="AA",1,IIF([FieldName]="A",2,IIF([FieldName]="B",3,4)))

NickNeville
10-25-2010, 06:21 AM
great I'll give it a try
many many thanks
Nick

NickNeville
10-26-2010, 02:26 AM
Hi Trevor
yea that worked a treat, all I had to do was sort on the report and that was done.
Yer a genius !
many thanks
Nick

Trevor G
10-26-2010, 02:33 AM
Glad that has worked for you Nick.

NickNeville
10-29-2010, 12:25 AM
Hi there trevor
I just realised that when I show the report it shows the topvalues of the first say 25 but is there a way of showing the top 5 values in each class ?
sorry about that, will I need to post this as a general question ?
Rgds
nick

Trevor G
10-29-2010, 12:33 AM
This may seem a little long winded but it will work.

What you can do, is create separate queries based on each grade and select to show the top 5, if you then append them into a temp table and run the report from the temp table then you have your solution.

Remember that you will need to run a delete query as well to empty the table before appending, once set up you can create a macro to run the process and it should be quick enough.

NickNeville
10-29-2010, 12:38 AM
Ok I'll give it a try
many thanks once more
best rgds
Nick