Random Name

D

Daysleeper

In a database I have 500 names and I want to randomly create a pair of
partner to work with each other- what is the easiest way to achieve this.



Many thanks

Daysleeper, uk
 
A

Allen Browne

Assuming that you have a numeric primary key field named (say) "ID", create
a query, and type this into a fresh column in the Field row:
Rnd([ID])
Under this field, set the sorting to Ascending.

The query sorts the records randomly. You can now pair them off.

For the sort to be random, you need to issue a Randomize before running the
query. Press Ctrl+G to open the Immediate window. Enter:
Randomize
and press Enter.
 
D

Daysleeper

It is not working my Select quires as follow- i'm doing something wrong:

SELECT User.ID, User.Name, User.ID

FROM [User]

WHERE (((User.ID)=Rnd([ID])))

ORDER BY User.Name;

thanks



Assuming that you have a numeric primary key field named (say) "ID", create

a query, and type this into a fresh column in the Field row:
Rnd([ID])

Under this field, set the sorting to Ascending.
The query sorts the records randomly. You can now pair them off.
For the sort to be random, you need to issue a Randomize before running the

query. Press Ctrl+G to open the Immediate window. Enter:
Randomize

and press Enter.

Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
"Daysleeper" <Anonymous> wrote in message
In a database I have 500 names and I want to randomly create a pair of
partner to work with each other- what is the easiest way to achieve
this.

Allen Browne said:
Assuming that you have a numeric primary key field named (say) "ID", create
a query, and type this into a fresh column in the Field row:
Rnd([ID])
Under this field, set the sorting to Ascending.

The query sorts the records randomly. You can now pair them off.

For the sort to be random, you need to issue a Randomize before running the
query. Press Ctrl+G to open the Immediate window. Enter:
Randomize
and press Enter.

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

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

Daysleeper said:
In a database I have 500 names and I want to randomly create a pair of
partner to work with each other- what is the easiest way to achieve
this.
 
A

Allen Browne

The idea is:
SELECT User.ID, User.Name
FROM [User]
ORDER BY Rnd([User].[ID]);

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

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

Daysleeper said:
It is not working my Select quires as follow- i'm doing something wrong:

SELECT User.ID, User.Name, User.ID
FROM [User]
WHERE (((User.ID)=Rnd([ID])))
ORDER BY User.Name;

thanks



Assuming that you have a numeric primary key field named (say) "ID", create

a query, and type this into a fresh column in the Field row:
Rnd([ID])

Under this field, set the sorting to Ascending.
The query sorts the records randomly. You can now pair them off.
For the sort to be random, you need to issue a Randomize before running the

query. Press Ctrl+G to open the Immediate window. Enter:
Randomize

and press Enter.

Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
"Daysleeper" <Anonymous> wrote in message
In a database I have 500 names and I want to randomly create a pair of
partner to work with each other- what is the easiest way to achieve
this.

Allen Browne said:
Assuming that you have a numeric primary key field named (say) "ID", create
a query, and type this into a fresh column in the Field row:
Rnd([ID])
Under this field, set the sorting to Ascending.

The query sorts the records randomly. You can now pair them off.

For the sort to be random, you need to issue a Randomize before running the
query. Press Ctrl+G to open the Immediate window. Enter:
Randomize
and press Enter.


Daysleeper said:
In a database I have 500 names and I want to randomly create a pair of
partner to work with each other- what is the easiest way to achieve
this.
 
D

Daysleeper

Thanks I have got this working now, but this does not solve my problem
fully.

I have 30 students each marking each other work, for instance:

A Marks B work

B Marks C works

C Marks A work



How do I avoid reciprocal marking, so stop B Marking A.



Is that possible to generate this kind of pairing for all the students?



Many thanks for all your help so far.





Allen Browne said:
The idea is:
SELECT User.ID, User.Name
FROM [User]
ORDER BY Rnd([User].[ID]);

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

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

Daysleeper said:
It is not working my Select quires as follow- i'm doing something wrong:

SELECT User.ID, User.Name, User.ID
FROM [User]
WHERE (((User.ID)=Rnd([ID])))
ORDER BY User.Name;

thanks



Assuming that you have a numeric primary key field named (say) "ID", create

a query, and type this into a fresh column in the Field row:
Rnd([ID])

Under this field, set the sorting to Ascending.
The query sorts the records randomly. You can now pair them off.
For the sort to be random, you need to issue a Randomize before running the

query. Press Ctrl+G to open the Immediate window. Enter:
Randomize

and press Enter.

Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
"Daysleeper" <Anonymous> wrote in message

In a database I have 500 names and I want to randomly create a pair
of
partner to work with each other- what is the easiest way to achieve this.

Allen Browne said:
Assuming that you have a numeric primary key field named (say) "ID", create
a query, and type this into a fresh column in the Field row:
Rnd([ID])
Under this field, set the sorting to Ascending.

The query sorts the records randomly. You can now pair them off.

For the sort to be random, you need to issue a Randomize before running the
query. Press Ctrl+G to open the Immediate window. Enter:
Randomize
and press Enter.


"Daysleeper" <Anonymous> wrote in message
In a database I have 500 names and I want to randomly create a pair of
partner to work with each other- what is the easiest way to achieve
this.
 
A

Allen Browne

Could you order on some strange combination of charcters, e.g.:
ORDER BY Mid([FirstName],2,2) & Mid([Street],3,2)

This places them in an order and should stop the reciprocal relation.

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

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

Daysleeper said:
Thanks I have got this working now, but this does not solve my problem
fully.

I have 30 students each marking each other work, for instance:

A Marks B work

B Marks C works

C Marks A work



How do I avoid reciprocal marking, so stop B Marking A.



Is that possible to generate this kind of pairing for all the students?



Many thanks for all your help so far.





Allen Browne said:
The idea is:
SELECT User.ID, User.Name
FROM [User]
ORDER BY Rnd([User].[ID]);

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

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

Daysleeper said:
It is not working my Select quires as follow- i'm doing something wrong:

SELECT User.ID, User.Name, User.ID
FROM [User]
WHERE (((User.ID)=Rnd([ID])))
ORDER BY User.Name;

thanks




Assuming that you have a numeric primary key field named (say) "ID",
create

a query, and type this into a fresh column in the Field row:

Rnd([ID])

Under this field, set the sorting to Ascending.



The query sorts the records randomly. You can now pair them off.



For the sort to be random, you need to issue a Randomize before
running
the

query. Press Ctrl+G to open the Immediate window. Enter:

Randomize

and press Enter.



--

Allen Browne - Microsoft MVP. Perth, Western Australia.



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



"Daysleeper" <Anonymous> wrote in message


In a database I have 500 names and I want to randomly create a pair of

partner to work with each other- what is the easiest way to achieve
this.

Assuming that you have a numeric primary key field named (say) "ID",
create
a query, and type this into a fresh column in the Field row:
Rnd([ID])
Under this field, set the sorting to Ascending.

The query sorts the records randomly. You can now pair them off.

For the sort to be random, you need to issue a Randomize before
running
the
query. Press Ctrl+G to open the Immediate window. Enter:
Randomize
and press Enter.


"Daysleeper" <Anonymous> wrote in message
In a database I have 500 names and I want to randomly create a pair of
partner to work with each other- what is the easiest way to achieve
this.
 
Top