Is there any way you can make a random selection of say 50 records from a database?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Selecting Random Records
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Selecting Random Records
- This topic has 3 replies, 4 voices, and was last updated 24 years ago.
Viewing 0 reply threadsAuthorReplies-
WSShane Sargent
AskWoody LoungerMay 4, 2001 at 5:41 pm #525151Roberta:
There sure is; check out the Rnd( ) function as well as the Randomize statement in Access help. If you have questions, post back.
A note of caution: I started to develop an app for my company to use for conducting random drug tests of its commercial drivers. After chatting with the folks in HR, we decided to use a 3d party product to minimize our legal liability. I’m not sure that this particularly applies to you, but…
-
WSd_rasley
AskWoody LoungerMay 5, 2001 at 1:05 am #525218This is one thing that I was wondering about. Say that I wanted to generate a random list of 100 out of 1000 records, using a Rnd() function. Rnd() is just that – random. Therefore, does there exist the potential that I might end up with ~90 unique records, and some duplicate records, for the total of 100? If so, how can this be avoided? (A first thought would be to query the results of the random selection, grouping & counting records, and redo if the record count doesn’t work out right… but this is rather ponderous.)
Switching roles from IT staff to Auditing staff, I would be interested in using some sort of random record selection process to pull lists of transactions to audit. However, I would need some assurance that the selection process worked efficiently with no potential for duplication.
As a side note: I strongly agree that the potential legal liability must be considered wherever a random selection may have additional repercussions.
-
WScharlotte
AskWoody LoungerMay 5, 2001 at 2:45 am #525221All the Rnd() function does, once you pass it a seed value, is generate a pseudo random number. If you sort on that number and use a top values query to give you the top 100, that should produce 100 random records. The only way you might get duplicates is if your underlying recordset contains duplicate records, which means you didn’t design something properly in getting to this point. If you use a Select Distinct in the underlying query, there should be no possibility of duplicate records.
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Trump signs Take It Down Act
by
Alex5723
6 hours, 56 minutes ago -
Do you have a maintenance window?
by
Susan Bradley
7 hours, 22 minutes ago -
Freshly discovered bug in OpenPGP.js undermines whole point of encrypted comms
by
Nibbled To Death By Ducks
8 hours, 30 minutes ago -
Success Knows No End in the World of Online Slots (Awaiting moderation)
by
isobelhartmann1
8 hours, 39 minutes ago -
Cox Communications and Charter Communications to merge
by
not so anon
10 hours, 16 minutes ago -
Help with WD usb driver on Windows 11
by
Tex265
15 hours, 25 minutes ago -
hibernate activation
by
e_belmont
19 hours, 11 minutes ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
22 hours, 58 minutes ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
1 day, 2 hours ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
1 day, 2 hours ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
10 minutes ago -
Out of band for Windows 10
by
Susan Bradley
1 day, 6 hours ago -
Giving UniGetUi a test run.
by
RetiredGeek
1 day, 13 hours ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
1 day, 21 hours ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
7 hours, 25 minutes ago -
Auto Time Zone Adjustment
by
wadeer
2 days, 1 hour ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
1 day, 23 hours ago -
Manage your browsing experience with Edge
by
Mary Branscombe
18 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
16 hours, 33 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
22 hours, 57 minutes ago -
Apps included with macOS
by
Will Fastie
20 hours, 49 minutes ago -
Xfinity home internet
by
MrJimPhelps
17 hours, 36 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
1 day, 18 hours ago -
Debian 12.11 released
by
Alex5723
2 days, 23 hours ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
3 days, 2 hours ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
2 days, 6 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
9 hours, 47 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
3 days, 19 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
3 days, 10 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
1 day, 7 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.