Last n Records

R

Rayh

Hi,
How do I extract the last n records for each member from a table.
Thanking you in anticipation.
Rayh
 
K

Ken Snell

You need to define what is meant by "first" and "last" based on some
criterion (for example, the records with the latest dates). You define this
order in a query, then use the TOP or BOTTOM options in the query's SQL
statement. See Help for more info; post back if you have additional
questions or can show specific info that would help us provide a suggested
solution.
 
J

John Vinson

Hi,
How do I extract the last n records for each member from a table.

Unless you have SOMETHING in the table to determine which record is
"last", there is no way to do this. A Table is an unordered "bucket"
of data - there is no usable "last record" or "first record", and
there are no "record numbers".

If you have a timestamp field defaulting to Now(), or a strictly
increasing field such as a sequential Autonumber or a custom Counter,
you can create a Query based on the table sorting by this field. Set
that query's Top Values property to the number of records desired.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ActiveX 1
Record Count on Forms 3
Command Button on Report 1
SetValue 5
Run Another Access File 1
Form AfterUpdate 2
CreateField 1
SELECT TOP 1

Top