Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / March 2006

Tip: Looking for answers? Try searching our database.

how do I only pull 5 records (random)?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
_Bigred - 23 Mar 2006 07:10 GMT
I am using               Random: Rnd(IsNull(PowerTabDirectory.Item)*0+1)

to pull random records, how do I only pull X number of records?

If I want 5 records - pull 5 random records.
If next time I run the query I want 3 random records - pull 3 random records

and so on?
strive4peace - 23 Mar 2006 07:30 GMT
Hi Bigred,

******** in design view of query

use the TopValues property
ie:
TopValues --> 3
TopValues --> 5

in property window for TopValues you can use "%" to get a
percentage of the records instead of a specific number

TopValues --> 10%

******** to modify the SQL Statement,

SELECT TOP # fieldlist FROM ...

where # is 3 or 5 or however many you want

in SQL: if you follow # with " PERCENT", you will get a
percentage of the records instead of a specific number

ie --> SELECT TOP 10 PERCENT fieldlist...

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com

> I am using               Random: Rnd(IsNull(PowerTabDirectory.Item)*0+1)
>
[quoted text clipped - 4 lines]
>
> and so on?
_Bigred - 23 Mar 2006 08:16 GMT
thanks much Crystal

> Hi Bigred,
>
[quoted text clipped - 40 lines]
>>
>> and so on?
strive4peace - 23 Mar 2006 09:31 GMT
you're welcome, Bigred ;)  happy to help

Have an awesome day

Warm Regards,
Crystal

MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com

> thanks much Crystal
>
[quoted text clipped - 42 lines]
>>>
>>>and so on?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.