[Access] Is this possible?

Associate
Joined
18 Oct 2002
Posts
2,161
Location
Here!
Hello.

Is it possible for a query to filter and sort the results and then just give me the first 5 results from the top of the list?

Its basically an allocation database and Ive got a table with loads of serial numbers that need putting in batches of 5, so I need the next 5 that havn't been allocated (ie. got a number in the batchID field) to come up in a form so I can put the same batchID to them, therefore making another batch of 5.

Sorry its hard to explain..but please help if you can.

Thanks a lot

Ross
 
In the properties for a query there is a field called 'Top Values'. Put 5 in there and it'll give you the top 5 of all the records that the query would return.
 
Alternatively, you can open the query in SQL view, and change 'SELECT *...' to be 'SELECT TOP 5 *...'

Although the above does the exact same thing without you having to actually change any SQL manually.
 
Back
Top Bottom