Hi,
Easy part:
I have a SQL table that contains a list of audits for certain processes in our company. There are 50 different audits. I would like for the user to open the app, press a button and the app tell them which audit to complete by random selection (1-50).
More complicated part:
If a number (audit) has already been assigned to a different user, the random number generator will run until it hits a number that has not already been assigned.
Summary:
I need a random generator that works between a specified range and will not land on the same number more than once.
My thought process on a solution:
These audits will be completed once a week. So I can create a SQL table to store all assigned audits (numbers) as the audits are submitted. Every week, run a SQL job to clear this table out. Use a lookup function to see if the number from the rand function exists in the table. If it does, keep running the rand function until it doesn't.
I have no clue how apply a range to the rand function and I have no clue how to build a loop like this? Maybe someone has a better approach.
Thank you,
-Justin