I have a questionnaire app that work mostly but I have a problem.
I fetch the total number of records in the DB and then select a record ID by using the random number generator. However, I wish to avoid presenting the same question twice so I included a field to hold the info about whether it had already been used.
The problem I now have is that, if the rnd function picks a valid number, that record might not be available in the DB and therefore everything crashes.
So, how can I pick a random number from a non-sequential number list?
Cheers
Penfound
I fetch the total number of records in the DB and then select a record ID by using the random number generator. However, I wish to avoid presenting the same question twice so I included a field to hold the info about whether it had already been used.
The problem I now have is that, if the rnd function picks a valid number, that record might not be available in the DB and therefore everything crashes.
So, how can I pick a random number from a non-sequential number list?
Cheers
Penfound