I need to pick 20 random files from a table with the only criteria is within a certain month. Can I do this through the Query by example without writing any code?
Louise99,
Maybe? You might might be able to use the random number generator. This example uses a combination of a Date/Time field in the table and the current time to create a seed that is feed to the random number generator.
Code:
SELECT TOP 20 KeyField
FROM YourTable
ORDER BY Rnd(Now()-[i]DateTimeField[/i]) DESC;
Everytime I requery I get a different subset of 20 records.
Hope this helps,
CMP
[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.