Here is what I have for a report that selects the top 3 winners:
I need to add a filter in the select top 3 where if the record is disqualified it will not show up and select the next top 3.
Also a filter that if the record is marked as 'best of' it will not show up in the top 3 and select the next top 3.
Data.DSQ is True / False
Data.BestOf is numeric value.
So I want to filter out Data.DSQ = True and Data.BestOf > 0 from the Select Top 3 records.
I have tried this many ways and I can't figure it out. The problem I have is that I can filter these out, but it will not just skip them: it does not continue to select the next records to total a Top 3.
ie: if 3 records and two are disqualified, I only return 1 record and not the next in the top 3 list.
Code:
SELECT Dupe.Class, Dupe.Score, Dupe.ID, Dupe.FName, Dupe.LName, Dupe.Year, Dupe.Make, Dupe.Model, Dupe.Judge FROM Data AS Dupe WHERE (((Dupe.Score)<>0 And (Dupe.Score) In (SELECT TOP 3 Data.Score FROM Data WHERE (((Data.Class)=Dupe.[Class])) ORDER BY Data.Score DESC))) ORDER BY Dupe.Class, Dupe.Score DESC , Dupe.ID;
Also a filter that if the record is marked as 'best of' it will not show up in the top 3 and select the next top 3.
Data.DSQ is True / False
Data.BestOf is numeric value.
So I want to filter out Data.DSQ = True and Data.BestOf > 0 from the Select Top 3 records.
I have tried this many ways and I can't figure it out. The problem I have is that I can filter these out, but it will not just skip them: it does not continue to select the next records to total a Top 3.
ie: if 3 records and two are disqualified, I only return 1 record and not the next in the top 3 list.
Comment