Randomly order the records in a table

J

John S. Ford, MD

Is there a way of creating a query that will randomly assort the records in
a table? Thanks in advance for any help with this.

John
 
A

Allen Browne

Assuming your table has an AutoNumber primary key field named "ID", try
typing this into the Field row in your query:
Rnd([ID])
and choose Ascending in the Sorting row under this field.

So that you do not get the same series of random numbers each session, you
also need to issue a Randomize each time you start Access. Open the
Immediate window (Ctrl+G) and enter:
Randomize
 
J

John S. Ford, MD

Thanks Allen. That worked perfectly!

John

Allen Browne said:
Assuming your table has an AutoNumber primary key field named "ID", try
typing this into the Field row in your query:
Rnd([ID])
and choose Ascending in the Sorting row under this field.

So that you do not get the same series of random numbers each session, you
also need to issue a Randomize each time you start Access. Open the
Immediate window (Ctrl+G) and enter:
Randomize

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

John S. Ford said:
Is there a way of creating a query that will randomly assort the records
in
a table? Thanks in advance for any help with this.
 

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