Random Item query selection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sesling
    New Member
    • Nov 2006
    • 84

    #1

    Random Item query selection

    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?
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    You have inadvertently posted your question in the Access Articles section. I'm moving it over to the Access Forum.

    Linq ;0)>

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      This will pull 10 random records, but, of course, you can easily modify that:
      [CODE=sql]SELECT TOP 10 Rnd(Len([PrimaryKeyField])) AS Expr1,YourTable .PrimaryKeyFiel d,YourTable.Fie ld1, YourTable.Field 2,YourTable.Fie ld3
      FROMYourTable
      ORDER BY Rnd(Len([PrimaryKeyField])) DESC;
      [/CODE]Good Luck!

      Linq ;0)>

      Comment

      • sesling
        New Member
        • Nov 2006
        • 84

        #4
        Originally posted by missinglinq
        This will pull 10 random records, but, of course, you can easily modify that:
        [CODE=sql]SELECT TOP 10 Rnd(Len([PrimaryKeyField])) AS Expr1,YourTable .PrimaryKeyFiel d,YourTable.Fie ld1, YourTable.Field 2,YourTable.Fie ld3
        FROMYourTable
        ORDER BY Rnd(Len([PrimaryKeyField])) DESC;
        [/CODE]Good Luck!

        Linq ;0)>
        Thanks for moving the message and the reply. It worked GREAT!!!

        Comment

        Working...