I try to get random question from a table. For that I use a query.
I found one answer to my question on but doesn't work.
***********************************************
Function Randomizer () As Integer
Static AlreadyDone As Integer
If AlreadyDone = False Then Randomize : AlreadyDone = True
Randomizer = 0
End Function
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)
******************************************************
This doesn't work for me because when I close the program and I run it again the app start to give the same sequency of records again every time. Please if anybody have any idea and can help me.
thank you for your time and your help
Trinitri
I found one answer to my question on but doesn't work.
***********************************************
Function Randomizer () As Integer
Static AlreadyDone As Integer
If AlreadyDone = False Then Randomize : AlreadyDone = True
Randomizer = 0
End Function
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)
******************************************************
This doesn't work for me because when I close the program and I run it again the app start to give the same sequency of records again every time. Please if anybody have any idea and can help me.
thank you for your time and your help
Trinitri