Full Version: Show last 12 records
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
astridhg
I have a table where the ID is a autonumber. How can I only get them to show the last 12 records at anytime?
mishej
Is the autonumber an indicator or sort order? Or is some other field define sort order?

The Jet specific clause " TOP 12 " will return 12 records in the order specified by the ORDER BY clause. (Ties will return more records. If you want only 12 you need to define tie-breakers.)
astridhg
Lost you there, I want the highest 12 numbers. Where would I put the "TOP 12"? blush.gif
mishej
In JET you would say 'SELECT TOP 12 * FROM <whatever> ORDER BY <whatever>;"

So order your query descending by number....
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.