Top 10 results from CrossTab Query.

aldeb

Registered User.
Local time
Today, 03:13
Joined
Dec 23, 2004
Messages
318
Below is the code I have for a crosstab query. This shows me totals for System Groups by Month. The columns are months. This also gives me a grand total accross all of the months. What I would like to do is get a Top Ten based on the GrandTotal. Any suggestions on how to accomplish this? Thanks for all help.

Code:
PARAMETERS [Forms]![Queries_ReportsFRM]![StartDateTxt] DateTime, [Forms]![Queries_ReportsFRM]![EndDateTxt] DateTime, [Forms]![Queries_ReportsFRM].[FaultCategory] Text ( 255 );
TRANSFORM Sum([Trends-1-3TON-MONTH].Totals) AS SumOfTotals
SELECT [Trends-1-3TON-MONTH].SystemGroup, [Trends-1-3TON-MONTH].FaultCategory, Sum([Trends-1-3TON-MONTH].Totals) AS GrandTotal
FROM [Trends-1-3TON-MONTH]
GROUP BY [Trends-1-3TON-MONTH].SystemGroup, [Trends-1-3TON-MONTH].FaultCategory
PIVOT [Trends-1-3TON-MONTH].YearMonth;
 
HI, aldeb!

I am not quite sure if you can use TOP 10 in crosstab query.
What I would do is very primitive- I would create a new SELCT query based on crosstab query with using SELECT TOP 10 from crosstabquery.......ORDER BY total field.

Krava
 
Thanks for your help!
 

Users who are viewing this thread

Back
Top Bottom