Select Top n AND Discard Ties -Ms Access 2010

Bonifes

Registered User.
Local time
Today, 22:21
Joined
Nov 22, 2013
Messages
13
I'm trying to design a query in which a sum is derived from a subquery which should select top 2 Currently this sometimes produces more than 2 where there are ties eg Select top 2 from (12, 10, 10 )... this produces all three so the sum is 32 instead of what I need... 22
Sample DB

Kind Regards
 

Attachments

If you are still having this problem...

Before applying the sum you must have no more than 2 records. Since you are only interested in the sum of a particulair field, use a distinct of only that field and select the top 2 records. After that you can apply the sum and you will result in 22.

HTH:D
 

Users who are viewing this thread

Back
Top Bottom