Top 5 Records

  • Thread starter Thread starter Manny
  • Start date Start date
M

Manny

Guest
Hi,
I have a Query that suppose to return the top 5 records from a table based on my selection.
Here is the SQL Statement.
SELECT TOP 5 qryMachineCountbyDate.Machine, Count(qryMachineCountbyDate.Machine) AS CountOfMachine
FROM qryMachineCountbyDate
GROUP BY qryMachineCountbyDate.Machine
ORDER BY Count(qryMachineCountbyDate.Machine) DESC;

Most of the time this works fine, but here is the dilema with my Datas.
Machine CountOfMachine
K20 19
K13 10
TT1 8
K19 7
TT2 7
KLS3 7
Why is the Query showing me 6 records?
Any Idea?
Thanks, Manny
 
When you have equivalent values it does not see as the same in a grouping query. Since 3 records have a value of 7 it sees them as equal.

Gumby
 
From Access Help:

If you specify that a specific number of records be returned, all records with values that match the value in the last record are also returned.
 

Users who are viewing this thread

Back
Top Bottom