RAND( ) Function

Example   See Also

Returns a random number between 0 and 1.

Syntax

RAND([nSeedValue])

Returns

Numeric

Arguments

nSeedValue

Specifies the seed value that determines the sequence of values RAND( ) returns.

RAND( ) returns the same sequence of random numbers if you use the same seed value for nSeedValue the first time you issue RAND( ) followed by subsequent RAND( ) function calls without nSeedValue.

If nSeedValue is negative the first time you issued RAND( ), a seed value from the system clock is used. To achieve the most random sequence of numbers, issue RAND( ) initially with a negative argument and then issue RAND( ) without an argument.

If you omit nSeedValue, RAND( ) uses a default seed value of 100,001.