introduction access training - querying number entries table

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum 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

resolvedResolved · 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 courses

 

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
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

Switchboard Startup

An option when you open your Access database that contains all of you tables, forms and queries is only the switchboard is displayed.

To achieve this, select Tools click on Startup. On the right hand side of the Startup screen you are able to select which form you want to open when you open you Access Database. Once you have selected this, there is a check box just below that says "Display Database Window", you need to uncheck this option. Then click ok.

Then when you close you Access database and re open it, the database should open with just the switchboard being shown


View all Access hints and tips


Server loaded in 0.09 secs.