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
|
|||
|
|||
Grabbing random records (access 2003)
Using Access 2003
I would like to randomly grab say 10 records from the table that the report is based on. How would I go about this? TIA, _Bigred |
#2
|
|||
|
|||
Grabbing random records (access 2003)
_Bigred wrote:
Using Access 2003 I would like to randomly grab say 10 records from the table that the report is based on. Base the report on a query Like: SELECT TOP 10 f1,f2,f3,... FROM table ORDER BY Rnd(posnumfield) Be sure to use the Randomize statement before opening the report. posnumfieldcan be any field that has a positive value in every record. If you don't have a field like that, use: Rnd(Abs(anynumfield) + 1) -- Marsh MVP [MS Access] |
#3
|
|||
|
|||
Grabbing random records (access 2003)
Create this query as the RecordSource for your report:
SELECT TOP 10 * FROM Table1 ORDER BY Rnd(Table1.ID), Table1.ID; Note that you need to issue a Randomize so that the sequences don't repeat. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "_Bigred" m wrote in message ... Using Access 2003 I would like to randomly grab say 10 records from the table that the report is based on. How would I go about this? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ambiguous Name Error | pm | Using Forms | 10 | June 5th, 2005 09:19 PM |
What is the difference between 2002 and 2003? | Red Sonya | General Discussion | 2 | March 1st, 2005 05:10 AM |
Book recommendations, please | Top Spin | New Users | 2 | March 1st, 2005 12:43 AM |
Access XP Compared to Access 2003 | Mardene Leahu | New Users | 1 | October 1st, 2004 05:11 AM |
Access 2003 | RK | General Discussion | 12 | June 14th, 2004 10:16 AM |