469,607 Members | 2,099 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,607 developers. It's quick & easy.

Random sample selection

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
2 1681
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
"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.

Similar topics

4 posts views Thread by Bart Nessux | last post: by
1 post views Thread by steflhermitte | last post: by
4 posts views Thread by Jesse Noller | last post: by
4 posts views Thread by Baz | last post: by
5 posts views Thread by jordi | last post: by
19 posts views Thread by Boris Borcic | last post: by
13 posts views Thread by Bruza | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.