Link to home
Start Free TrialLog in
Avatar of robrodp
robrodpFlag for Mexico

asked on

random record selection asp and access

I want to select a random record with:

select top 1 * from llamadas order by newid()

With my MS SQL database it works fine but it gives an error with mdb files
ASKER CERTIFIED SOLUTION
Avatar of sajuks
sajuks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
try like...

...

Randomize
RndKey = Int (1000*Rnd)+1

SQLstr = "SELECT Top 1 Rnd(" & -1 * RndKey & " * id), " & _
                   "llamadas.* " & _
                   "FROM llamadas "
                   "Order By 1 "

....