Hello,
I want to retrieve 10% of the records in a table, but want them to also be
randomly selected. In other words, I want to randomly subsample a group of
records.
Does anybody know how this can be done, either in SQL or VBA?
Thank you very much.
Duane Hookom - 13 Mar 2008 20:58 GMT
This question would have been more appropriate in the MS Access Queries NG.
You can select the TOP 10 PERCENT of the records ordered by the RND()
function like:
SELECT TOP 10 PERCENT Rnd([OrderID]) AS Expr1, Orders.*
FROM Orders
ORDER BY Rnd([OrderID]);

Signature
Duane Hookom
Microsoft Access MVP
> Hello,
>
[quoted text clipped - 5 lines]
>
> Thank you very much.