The following crosstab query lists a set of results based on a total score:
The total score (TotalFibua)is based on the sum of six events, the scores for which are shown when the query is run.
From this query, I can create a report in which I can sort initially by TotalFibua and then by the scores for each individual event (LngEventRef) or combination thereof. This resolves the problem of a tie with the total score.
In order to publish the results, I need to isolate first and second place, as generated in the report, into a new report but I cannot find a way of selecting the top 2 in a crosstab query, or from the report that is based on it.
Is there a way of achieving this, either from the crosstab query or being selective in the report (which is already sorted)?
Best Regards
John
Code:
TRANSFORM Sum(QryFibuaComb_Team.Score) AS SumOfScore
SELECT QryFibuaTeam.TxtUnit, QryFibuaTeam.TotalFibua AS Total, QryFibuaTeam.Honours_Only, TblBisleyYear.BisleyYear
FROM (TblBisleyYear INNER JOIN QryFibuaTeam ON TblBisleyYear.BisleyYear = QryFibuaTeam.BisleyYear) INNER JOIN QryFibuaComb_Team ON QryFibuaTeam.TxtUnit = QryFibuaComb_Team.TxtUnit
GROUP BY QryFibuaTeam.TxtUnit, QryFibuaTeam.TotalFibua, QryFibuaTeam.Honours_Only, TblBisleyYear.BisleyYear
ORDER BY QryFibuaTeam.TotalFibua DESC
PIVOT QryFibuaComb_Team.LngEventRef;
The total score (TotalFibua)is based on the sum of six events, the scores for which are shown when the query is run.
From this query, I can create a report in which I can sort initially by TotalFibua and then by the scores for each individual event (LngEventRef) or combination thereof. This resolves the problem of a tie with the total score.
In order to publish the results, I need to isolate first and second place, as generated in the report, into a new report but I cannot find a way of selecting the top 2 in a crosstab query, or from the report that is based on it.
Is there a way of achieving this, either from the crosstab query or being selective in the report (which is already sorted)?
Best Regards
John