If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
produce random results in a report
I'm trying to write a report that will produce random results each time it is
run. There are approximately 300 records in my database. For each record, I have included a field with a number identifier (1-7). Each time I run the report, I want it to choose records randomly based on the following list (the number represents the identifier). 2 2 1 7 7 7 5 3 4 6 |
#2
|
|||
|
|||
produce random results in a report
On 15.12.2009 04:12, DamselNTX wrote:
I'm trying to write a report that will produce random results each time it is run. There are approximately 300 records in my database. For each record, I have included a field with a number identifier (1-7). Each time I run the report, I want it to choose records randomly based on the following list (the number represents the identifier). Use http://www.mvps.org/access/queries/qry0011.htm and http://msdn.microsoft.com/en-us/libr...d2(VS.80).aspx and instead of a ORDER BY clause use a WHERE like this WHERE [NumberField] = CInt(Int(Rnd()*7+1)) The important part is to use a Rnd() without a field as parameter, so that the function will only be executed once. mfG -- stefan -- |
Thread Tools | |
Display Modes | |
|
|