Help creating an update loop

frustrating

Registered User.
Local time
Today, 14:34
Joined
Oct 18, 2012
Messages
68
Hey everyone,

I'm having a pretty hard time creating what should be a pretty simple query. I have a field called "Random" which I want to populate the fields with either a 0 or 1. The problem is I use this query:

Code:
UPDATE words SET words.Random = Int((1-0+1)*Rnd()+0);

Which obviously changes them all to a 0 or 1, but I need it to do it for each record separately.

Any ideas on how to create a query that loops through each one and performs that function?
 
This article seems to focus on returning random records, and those records appear to be randomized based off their field data. I need something that will be a coin toss each time, and not consistently the same.

I already was able to randomize my records, what I need, however, is to insert either a 0 or 1 into my "random" field, and base how my forms look on that value.

So for example, if the field has a 0 as a value, the form will hide a specific field and show another. If the form has a 1, then it will display the opposite.

Each time I try and do this, it updates the entire column to the same number, though it is random.
 
I solved this. Turns out I was making too much work for myself. I just created a function that performed the random calculation and used that variable in my code when each record loaded.
 

Users who are viewing this thread

Back
Top Bottom