I have a SQL query Generating 2 Random numbers, the first pulls a number 100 - 999, the Second currently pulls a number 1-500.
The problem, I need to insert an if statement to Verify against an ID # in the main table, if the number does not exist I need the random generator to run and pull a new number.
The Code.
The problem, I need to insert an if statement to Verify against an ID # in the main table, if the number does not exist I need the random generator to run and pull a new number.
The Code.
Code:
DoCmd****nSQL "SELECT Int((999-100+1)*Rnd()+100) AS RanNum, Int((500-1+1)*Rnd()+1) AS RanID INTO tbl_Temp;"