truly urgent - need to generate random, nonduplicating 9 digit number

russi

Registered User.
Local time
Today, 11:16
Joined
Jul 18, 2000
Messages
385
Hi.
I have major report due within hours.
I need to add a field to existing table that will be a 9 digit number, non duoplicating or - to take an existing field of 9 digits and allow it's values to change to random or incremental, non-duplicate numbers of 9 digits. I already have an autonumber field I must keep.

Russ
 
internal randon number generator generates a real number between zero and 1. therefore any randon number can be multiplied by 10^9 to give a 9 figure number. I believe the accuracy of a double will have enough significant digits to give you your 9 figure random number. If you like dismiss any number starting with a zero. Look at help on RNG, as it will actually generate idenitical RN sequences (good for testing apps) unless you reseed the RNG.

Anyway, Do you really need a population of 1 billion (9 figure numbers).
 
Not sure what you mean, but if all you need to do is create a new field in a table, that contains a series of non-repeated 9-digit numbers, then...

First, create a field in design view of your table.

Then, in excel create a list of 9-digit numbers in a column that is as long as you need to match the number of records in your table. Then highlight the cells in the excel spreadsheet column and copy, then open your table in access, right click in the header of the new field of your table and choose paste from the right-click menu.
 

Users who are viewing this thread

Back
Top Bottom