Creating Queries

Access gives you three ways to create a query:

  • The Query wizard gives you a quick-and-dirty way to build a simple query. However, this option also gives you the least control.

    Tip

    If you decide to use the Query wizard to create your query, then you’ll probably want to refine your query later on using Design view.

  • Design view offers the most common approach to query building. It provides a handy graphical tool that you can use to perfect any query.

  • SQL view gives you a behind-the-scenes look at the actual query command, which is a piece of text (ranging from one line to more than a dozen) that tells Access exactly what to do. The SQL view is where many Access experts hang out—and though it seems intimidating at first glance, it’s actually not that difficult to decipher (as you’ll see on Understanding the SQL View).

Creating a Query in Design View

The best starting point for query creation is the Design view. The following steps show you how it works. (To try this yourself, you can use the BoutiqueFudge.accdb database that’s included with the downloadable samples for this chapter.) The final result—a query that gets the results that fall in the first quarter of 2010—is shown in Figure 6-6.

Here’s what you need to do:

  1. Choose Create→Queries→Query Design.

    A new design window appears, where you can craft your query. But before you get started, Access pops open the Show Table dialog box, where you can choose the tables that you want to work with (Figure 6-1 ...

Get Access 2010: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.