By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,853 Members | 2,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,853 IT Pros & Developers. It's quick & easy.

Random sample selection

P: n/a
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <rj*@yahoo.com> wrote in message
news:Ow****************@TK2MSFTNGP14.phx.gbl...
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #2

P: n/a
"RJN" <rj*@yahoo.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.