Random sample selection

  • Thread starter Thread starter RJN
  • Start date Start date
R

RJN

Hi

I have to randomly pickup records from database for some quality check
of data. Say the data base has about 1000 records, I have to randomly
select about 50 records. Can someone suggest me some simple Random
generator algorithm to do this?

Thanks

RJN
 
From the Random Function in help file:
Dim MyValue As Integer
Randomize ' Initialize random-number generator.
MyValue = CInt(Int((6 * Rnd()) + 1)) ' Generate random value between 1 and
6.

There is also a Random Class that will do this for you. I haven't used it
but it looks trivially simple.

Chris
 
RJN said:
I have to randomly pickup records from database for some quality check
of data. Say the data base has about 1000 records, I have to randomly
select about 50 records. Can someone suggest me some simple Random
generator algorithm to do this?

'Random.Next' -- F1.
 

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

Back
Top