Select only the last 10 occurance in a query

  • Thread starter Thread starter jon
  • Start date Start date
J

jon

In a query I need to show only the last 10 of a selected field.
The field has different component No:
Some components will have only 5 occurrences others will have 20.
I only want to see the last 10 (or less if less component No:s have been
made)

Any advise please.

Thanks


Jon
 
In a query I need to show only the last 10 of a selected field.
The field has different component No:
Some components will have only 5 occurrences others will have 20.
I only want to see the last 10 (or less if less component No:s have been
made)

Any advise please.

You can use the "Top Values" property of a query to limit it to ten
(or any desired number) of records. The query must be sorted by some
field, though - Access does not keep track of when records were
entered (unless you do so yourself), and Tables have no meaningful
order, so "the last ten records" is ambiguous.

John W. Vinson[MVP]
 
If each component has a time element attached to it then it shouldn't be a
problem. Otherwise you will have difficulty in specifying the last ten
records.

I have the same query, but each of my records has a date attached.
 
Not quite what I need but that is due to my poor description.

I will start a new post with a better description.

Thanks

Jon
 
Thanks
In a query I need to show only the last 10 of each component No in a
selected field.
The field has different component No:
Components have occurrences from 1 upwards.
I only want to see the last 10 of each component No in the field (or less
where less jobs have been made)
There is another date field in the table, and the table is grouped by
component No the sorted by date so I just need the last 10 of each component
No:
 
Back
Top