Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rnd in a query 1

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
I use the Random Function Rnd in a query.

Code:
      AdRandomNr = Int((243365 * Rnd) + 1)

However in the query I got always the same number for every row (so its not a random number). eg. 178596.

What is missing ?
 
He always takes the actual time or seconds.
Is there a fuction to get the actual milliseconds ?
 
You might want to post some more code and let know what you are trying to accomplish.

Mike
 
well infact nothing more then an expression to get a random number via the function in a query. He always produce the same number (far from ad random). I looked up the function on the web.

Code:
Expr1:Int((1500000-1+1)*Rnd()+1)

The value should be an Integer (so not more then 32000 ?) or is 1.500.000 not a problem ?
 
MajP, thanks,

I did no test it already but it have the idea that is a good answer (solution) to this problem.
 
I tested one of the solutions (the update query) and it works fine even on 1.500.000 records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top