How do I get a percentage of randomly selected records?

G

Guest

I need to create an audit report with randomly selected records from a table.
Is there a criteria that would randomly select a percentage of a table's
records?

I'm using Access 2003.
 
A

Allen Browne

Assuming a primary key field named ID (type Number or AutoNumber):

SELECT TOP 10 PERCENT tblClient.*
FROM tblClient
ORDER BY Rnd([ID]);

Don't forget to Randomize first.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top