Sep 25 2007, 03:40 AM
I have a table where the ID is a autonumber. How can I only get them to show the last 12 records at anytime?
Sep 25 2007, 03:44 AM
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.)
Sep 25 2007, 03:58 AM
Lost you there, I want the highest 12 numbers. Where would I put the "TOP 12"?
Sep 25 2007, 04:08 AM
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