Query to return last ten records

danzweb

New Member
Joined
Apr 25, 2004
Messages
2
Hi there,

This is the first time I have posted on a message board so please be gentle with me, thanks.

I have got the basics of Access but have come across a stumbling block, I have a very simple table showing

Staff Name
Date Assessed
Grade

I am trying to write a query to return the last ten records of a staff member.

I have the query to prompt me for the staff name, which works but returns all records for that member of staff.

Is there any way that I can ask the query to select the last ten records of that staff name by date descending.

Hope this makes sense, I have asked around at work but nobody knows how to do this.

Any help would be gratefully appreciated.

Dan
:rolleyes:
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Open the SQL view of your query and substitute this, replacing Table2 with the name of your table.

SELECT TOP 10 Table2.[Staff Name], Table2.[Date Assessed]
FROM Table2
ORDER BY Table2.[Date Assessed] DESC;

Alternatively right click in the query design view and select Properties.

In the Top Values property field put 10, or whatever number you want.
 
Upvote 0

Forum statistics

Threads
1,221,710
Messages
6,161,445
Members
451,706
Latest member
SMB1982

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top