equestrian
Technical User
I have qryPointsByDivision.
It shows: DivisionNum_fk, EntryNum_fk, SumofPoints
I need EntryNum_fk, and SumofPoints for the 2 highest SumofPoints for each DivisionNum_fk.
I put:
in the criteria for SumofPoints, but this returns the top 2 SumofPoints for the entiry qryPointsByDivision. I know that I need to somehow group this, but I am not sure how to enter it in my query.
The sql code is:
Can anyone help me with this?
It shows: DivisionNum_fk, EntryNum_fk, SumofPoints
I need EntryNum_fk, and SumofPoints for the 2 highest SumofPoints for each DivisionNum_fk.
I put:
Code:
In (Select Top 2 [SumofPoints] From qryPointsByDivision Order By [SumofPoints] Desc)
The sql code is:
Code:
SELECT qryPointsByDivision.DivisionNum_fk, qryPointsByDivision.EntryNum_fk, qryPointsByDivision.SumOfPoints
FROM qryPointsByDivision
WHERE (((qryPointsByDivision.SumOfPoints) In (Select Top 2 [SumofPoints] From qryPointsByDivision Order By [SumofPoints] Desc)));
Can anyone help me with this?