SQL Query to SELECT records in Random Order in MS Access database

Last Reply on Jan 26, 2013 12:52 AM By baijuep

Posted on Jan 23, 2013 08:11 AM

in a query in my sqldatabase web i used this code

SELECT TOP 1 Quotes,Author FROM QUOTES ORDER BY NEWID()

but not working in access database web

 

Posted on Jan 24, 2013 12:12 AM Modified on on Jan 26, 2013 09:27 AM

Try following in MS Access

SELECT TOP 1 Quotes,Author FROM QUOTES ORDER BY rnd()

 


Posted on Jan 26, 2013 12:52 AM

i solved with a little edit on your code

SELECT TOP 1 Quotes, Author FROM QUOTES ORDER BY Rnd(-10000000*TimeValue(Now())*[id])

and it works fine