Merline has attended:
Excel Introduction course
Excel Intermediate course
Excel Advanced course
Querying number of entries in a table
How do I query a table and return the last e.g. 5 entries and no other?
RE: Querying number of entries in a table
Hi Merline
Are you referring to Excel or Access?
Regards
Richard
RE: Querying number of entries in a table
Sorry, Access
RE: Querying number of entries in a table
Hi Merline
If you are familiar with SQL statements you can do it by using the "TOP" statement next to the SELECT Statement.
For example
SELECT TOP 5 (will select the top 5 records, by sort order)
Or
SELECT TOP 10 (will select the top 10 records, by sort order)
So, if you go to your query, choose SQL from the view button, and then modify your query to include the TOP 5 statement, as above, that will give you 5 records. Switch the sort order in the query fields between acending and decending to get the results you are looking for.
So you SWL statement may look llike this
SELECT TOP 5 TableName.FieldName
FROM TableName
ORDER BY TableName.FieldName;
Hope that helps, and sorry for the delay in getting back to you.
regards
Richard
Microsoft Access Specialist and Trainer