Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


random record selection asp and access

Posted on 2006-05-28
Medium Priority
Last Modified: 2012-06-22
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
Question by:robrodp
LVL 33

Accepted Solution

sajuks earned 2000 total points
ID: 16782014
use the rnd function in access....

select top 1 *
FROM [llamadas]
ORDER BY RND(llamadas_ID);
LVL 55

Expert Comment

by:Ryan Chong
ID: 16782315
try like...


RndKey = Int (1000*Rnd)+1

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


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Screencast - Getting to Know the Pipeline
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question