From the course: Access 2021: Queries

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Pull random records from the database

Pull random records from the database

From the course: Access 2021: Queries

Pull random records from the database

- [Instructor] Occasionally you'll want to do a spot check or perform an audit on the data that's in your database. And while you don't want or need to review every single record it would make sense to review a random sampling of the information that you're storing. Let's suppose that you need to do a customer survey of 10 customers, and you wanted to be sure to get random customers to call so that you don't introduce bias into these survey results. Here's how to have Access pull the records for you. We'll create a new query in design view and add the customer's table. Then we'll pull down the first name, last name, and the customer phone number columns. Next we'll come to the fourth column and I'll right click and go into the expression builder. We'll drill into the built-in functions and click the math category. Here we'll find a function called R and D, which stands for random, and it simply returns a random number.…

Contents