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

introduction access training - querying number entries table

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

ResolvedVersion 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

Access tip:

Label printing

You can create a report in Access for printing labels All you have to do is is click New under the Reports object and then select Label Wizard and follow the steps

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.