Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random selection working but...

Status
Not open for further replies.

19thJIS

Technical User
Aug 22, 2003
4
0
0
US
Greetings,

I have a user that I created a random selection query. It is working the way it supposed to but now she wants one of the other fields within the query to be 1/2 of those selected. I.E., a person can be selected as a chairman or panelist. The user needs half of those selected to be chair qualified. Any ideas on how I can do this and still make it random?

Thanks

Chuck
 
I would generate a set of n random people. I would then calculate how many I was short of 50%. I would then substitute until 50% was realised

Let's say you pick 10 people but only have 3 chairman-qualified. Discard the first two people and continue to pick two more random people. Repeat this until you hit 50%ie until the ones you picked were all qualified.

The logic is, if your process is random, it doesn't matter if you pick people from the same place in the recordset as you build it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top