H
HelenJ
I'm sure this is possible but I just can't work out a way, I'm sure some
clever person can
I have a competition and there are classes, which people can win and get
points, the classes are organised into different sections. There are cups
for the person with the most points in a section. I would like to produce a
list that shows the cups and the winners of each section.
Using the following SQL I can easily produce a report showing the total
points that each person has gained - but I cannot find a way of listing just
the top one (and what if there are 2 with the same number of points?)
SELECT CupSectionsqry.CupName, [Prize money].SectionName, Sum([Prize
money].Points) AS SumOfPoints, Exhibitors.Surname, Exhibitors.FirstName,
Exhibitors.Title
FROM CupSectionsqry INNER JOIN ([Prize money] INNER JOIN Exhibitors ON
[Prize money].ExhibitorID = Exhibitors.[Exhibitor ID]) ON
CupSectionsqry.SectionID = [Prize money].SectionID
GROUP BY CupSectionsqry.CupName, [Prize money].SectionName,
Exhibitors.Surname, Exhibitors.FirstName, Exhibitors.Title
ORDER BY Sum([Prize money].Points) DESC;
Thanks.
clever person can
I have a competition and there are classes, which people can win and get
points, the classes are organised into different sections. There are cups
for the person with the most points in a section. I would like to produce a
list that shows the cups and the winners of each section.
Using the following SQL I can easily produce a report showing the total
points that each person has gained - but I cannot find a way of listing just
the top one (and what if there are 2 with the same number of points?)
SELECT CupSectionsqry.CupName, [Prize money].SectionName, Sum([Prize
money].Points) AS SumOfPoints, Exhibitors.Surname, Exhibitors.FirstName,
Exhibitors.Title
FROM CupSectionsqry INNER JOIN ([Prize money] INNER JOIN Exhibitors ON
[Prize money].ExhibitorID = Exhibitors.[Exhibitor ID]) ON
CupSectionsqry.SectionID = [Prize money].SectionID
GROUP BY CupSectionsqry.CupName, [Prize money].SectionName,
Exhibitors.Surname, Exhibitors.FirstName, Exhibitors.Title
ORDER BY Sum([Prize money].Points) DESC;
Thanks.