- cannot manually edit applicationhost.config
- must declare the scalar variable
- classic asp and access not working on windows 2008 64bit
- asp.net page titles are blank
- sql to get totals for last six months
- white space being counted as a node
- cross page posting not working
- collection is read only exception
- PayPal sending incorrect carrier information
- paypal guest user notice
- classic asp dictionary not working
- IE8 not supporting innerHTML
- differences between jet and odbc
- sugarcrm not inserting email
- select random records from access
- button click event firing twice
- how to send an email using cdosys
- installing perl on win2003 64 bit
- asp.net page event order
- rewrite rule for subdomains only
- extra items in javascript array
- IE7 margin auto not working
- IE7 border style dotted glitch
- ByRef and ByVal in vbscript
- weather rss feed
- Classic asp crib sheet
- Firefox onsubmit image change
- limit records in access
- AccessDataSource is thick
- double margins in IE6
- extra image padding in html emails
- decimal places in linux flash player
- broken emails in outlook 2007
- double spaced IE list items
- cannot remove movieclip
articles:
select random records from access
Here is a very simple way of selecting random records from an Access database:
SELECT TOP 5 * FROM [tableName] ORDER BY rnd(INT(NOW*id)-NOW*id)
The only prerequisite is that you have an AutoNumber Id column. It should also be noted that although this generates a random set of records, they are not truely random in a mathematical sense, but should be sufficiently random for most uses.
This method of selecting records also works in sql server, but you have to change rnd to rand.
Comments
Posted on 24 April 2011 15:14:00 GMT by anonymous
many thanks. works like a charm.
Posted on 08 July 2011 11:48:00 GMT by Nidhin.K.V
Thanku frrnd..
its wrkng
its wrkng
Posted on 01 August 2011 20:13:00 GMT by Bob
Worked without a hitch! Thank you!
Posted on 09 September 2011 12:39:00 GMT by professionalsna
Thanks it Works for me
Posted on 03 February 2012 12:11:00 GMT by Eduardo Simoes
Cool,tnx for share
Post a comment

now with this code every time i run the query gives me a different set of rows!!
thank you very much!!!