M
Max
Thanks to Joe Foster, Below is a code he wrote. My question is:
How would I modify his code to promet a user to enter the random number of
record he/she would like to get?
In the below code it was hard coded to be a 100 recrod.
I used his following code:
(Q) How can I return Random records from a table?
(A) Paste the following function in a new module.
'************ Code Begin ***********
'Code courtesy of
'Joe Foster
Function Randomizer () As Integer
Static AlreadyDone As Integer
If AlreadyDone = False Then Randomize : AlreadyDone = True
Randomizer = 0
End Function
'************ Code End *************
Now to get 100 questions picked at random:
select top 100 mytable.*from mytable
where randomizer() = 0
order by rnd(isnull(mytable.question) * 0 + 1)
How would I modify his code to promet a user to enter the random number of
record he/she would like to get?
In the below code it was hard coded to be a 100 recrod.
I used his following code:
(Q) How can I return Random records from a table?
(A) Paste the following function in a new module.
'************ Code Begin ***********
'Code courtesy of
'Joe Foster
Function Randomizer () As Integer
Static AlreadyDone As Integer
If AlreadyDone = False Then Randomize : AlreadyDone = True
Randomizer = 0
End Function
'************ Code End *************
Now to get 100 questions picked at random:
select top 100 mytable.*from mytable
where randomizer() = 0
order by rnd(isnull(mytable.question) * 0 + 1)