98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » introduction access training - Querying number of entries in a table
introduction access training - Querying number of entries in a table
Resolved · Low Priority · Version Standard
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
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Switchboard StartupAn option when you open your Access database that contains all of you tables, forms and queries is only the switchboard is displayed. |