Random Numbers everytime you run the Report (1 Viewer)

Phredd

Registered User.
Local time
Tomorrow, 06:36
Joined
May 28, 2002
Messages
34
:confused:

I have teams for example , Red, Blue, Green and Black. (Except there are 20 or more.)

Each week they need to be in a differant order.

I tried =rnd() in a Query this gives them all the same number, and if done in a report won't sort. It needs to change every time the report is run...

Please help or even email me a simple example.... mickb-at-hotpop.com

Slowly going insane....

Thanks
 

Phredd

Registered User.
Local time
Tomorrow, 06:36
Joined
May 28, 2002
Messages
34
Differant type of Random

Hopefully it is acceptable to upload a small file...

I need to randomly sort each team on the attachment every time the report is run...

It sounds so simple...

I am sure someone could look at this and do it in 30 sec, but its loosing me.

Sorry if I am asking too much, but it its very frustrating.
 

Attachments

  • Random Teams.zip
    13.6 KB · Views: 102
Last edited:
Local time
Today, 13:36
Joined
Aug 2, 2004
Messages
272
This seems to work for me. [caution - not thoroughly tested]

Query:

SELECT
Table1.Team
, Table1.[Team Number]
, Rand([Team Number]) AS Expr1

FROM
Table1;

Function:

Function Rand(intInput) As Integer
Randomize
Rand = Int((99 * Rnd) + 1)
End Function
HTH :D
 

Phredd

Registered User.
Local time
Tomorrow, 06:36
Joined
May 28, 2002
Messages
34
Yah............Thanks

Many thanks.

It is now doing what I wanted.

Now i can see it working, I can debug and modify...

Thanks again.
 

Users who are viewing this thread

Top Bottom