update query with rnd function

gogaak

Registered User.
Local time
Today, 23:15
Joined
Feb 6, 2005
Messages
42
hello all
I am trying to set column values to a random number between 3 and 5

PMRating
  • TokenID: text
  • H1: double
  • YearID: text

Code:
UPDATE PMRating SET PMRating.H1 = (5+3-3)*Rnd()+3
This shows type mismatch error . What is the problem here..


please do help...Thank you
 
UPDATE PMRating SET PMRating.H1 = Int(Rnd(1)*3)+3

The problem you may find with this is that it might update all records with the same random number throughout the table.
 
RichO said:
UPDATE PMRating SET PMRating.H1 = Int(Rnd(1)*3)+3

The problem you may find with this is that it might update all records with the same random number throughout the table.


Thanx alot..
Is there any way I could update the column values to unique random values...instead of the same value....and i also need double type number
is this query right?
Code:
UPDATE PMRating SET PMRating.H1 = dbl(Rnd(1)*3)+3
 

Users who are viewing this thread

Back
Top Bottom