J
Janice
In Access 2003 I need to randomly divide the data in a table.
Graham Mandeno said:Hi Janice
[Sorry about AK - you get all types in a public forum!!]
If your table includes a field that is guaranteed to have a positive number
in it (for example an AutoNumber field) then you can create a query on the
table with a calculated field such as this:
RandomOrder: Rnd([FieldName])
This field will have a random number >=0 and <1.
You can then sort your query on that field and thus return the records in a
random order, or use a TOP N query to select N random records from the
table.
You can also assign records to random groups like this:
RandomGroup: Int(Rnd([FieldName]) * 6)
This will generate one of 6 random integers from 0 to 5 inclusive, which you
can use to group or divide the records.
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
Janice said:In Access 2003 I need to randomly divide the data in a table.