Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Random Recordset with Access

Status
Not open for further replies.

bont

Programmer
Sep 7, 2000
200
US
Hello,

I would like to know what the best way to retrieve 3 random records from an Access 2002 Database would be using a SQL call from VBScript? I have tried generating 3 random ID from a range. This has failed to my failure to create 3 unique ID quickly. (This might be one way someone could help). The second way I had found was to use the RND function in a function such as this:"select TOP 3 FileName, Path, TPath, PixWidth, PixHeight, Rnd(ID) from Images", but it returns the same values over and over. I would like more variance. Any Ideas how to make if vary more using just a single SQL call?


 
Try Randomize and Rnd in VBScript

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top