By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Random Item query selection

P: 84
I have a real head scratcher here. Our Audit department wants to view records that our operators update in our customer account table. They want us to randomly pull records from the table. Is there a query method that will pull records randomly?
Jul 26 '07 #1
Share this Question
Share on Google+
3 Replies


missinglinq
Expert 2.5K+
P: 3,532
You have inadvertently posted your question in the Access Articles section. I'm moving it over to the Access Forum.

Linq ;0)>
Jul 26 '07 #2

missinglinq
Expert 2.5K+
P: 3,532
This will pull 10 random records, but, of course, you can easily modify that:
Expand|Select|Wrap|Line Numbers
  1. SELECT TOP 10 Rnd(Len([PrimaryKeyField])) AS Expr1,YourTable.PrimaryKeyField,YourTable.Field1, YourTable.Field2,YourTable.Field3
  2. FROMYourTable
  3. ORDER BY Rnd(Len([PrimaryKeyField])) DESC;
  4.  
Good Luck!

Linq ;0)>
Jul 26 '07 #3

P: 84
This will pull 10 random records, but, of course, you can easily modify that:
Expand|Select|Wrap|Line Numbers
  1. SELECT TOP 10 Rnd(Len([PrimaryKeyField])) AS Expr1,YourTable.PrimaryKeyField,YourTable.Field1, YourTable.Field2,YourTable.Field3
  2. FROMYourTable
  3. ORDER BY Rnd(Len([PrimaryKeyField])) DESC;
  4.  
Good Luck!

Linq ;0)>
Thanks for moving the message and the reply. It worked GREAT!!!
Jul 26 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.