Randomize Query

GlennOwns

Registered User.
Local time
Today, 01:44
Joined
Mar 30, 2012
Messages
11
I have a table with 4 fields. Each field is supposed to be randomized.

So i have the following:

organizations (50),
measures (20),
days of month (31*6 to make 186),
times of day (200).

Each month I want to click a button that creates a table that has 186 records (1, 1, 1, 1, 1, 1, 2, 2, ,2... for every day*6). And with these 186 records, I want to have the 20 measures randomized thoughout, the 200 times of day randomized throughout, and the 50 organizations randomized throughout. So it should look like this:

Day1, Organization12, Measure18, Time157
Day1, Organization41, Measure4, Time54
....


Basically, randomize the organization/measure/time against the 186 records throughout. I tried RndNum([Time_ID]) in a query and Sort by Ascending... But that just works with ONE.. When I put the 4 RndNums together in the same query, it takes 30+ minutes because they all randomize against eachother and create WAY more records than needed (even though I limit the view to 186...)..

Does anyone have a better way to approach this? I also tried doing separate tables and separate queries, but combining records that AREN'T based on anything is too hard for me to figure out... For instance, four tables with varying size of records (186, 50, 20, 200) and 1 property/table. How do I get those all to union/combine based on nothing? If I create an autonumber field, the smallest one (20) will stop autonumbering at 20 and the join is broke. How do I get this to keep repeating and such..

This is very complicated for me. Your help is much appreciated. Thank you.

-Glenn
 
You have done quite a job telling HOW you have approached something. However, you have not said, in plain English, WHAT it is you are trying to do. Perhaps if you describe the "issue you are trying to solve", someone will offer suggestions/recommendations/advice/options.
 
Sorry for letting this thread die with no resolution!

I talked with a buddy of mine and he simply moved what I was doing over from the Query into a form..

So it was pretty straight forward. I simply needed to write it VBA with SQL references to the data. If anyone is having an issue with the rnd(), just reactive this thread!
 

Users who are viewing this thread

Back
Top Bottom