Running Database Queries

In Access XP running database queries may seem confusing at first. This free lesson offers step-by-step instructions.

Creating a multi-table query

Queries are not confined to just a single table. You can create a query that runs against multiple fields in multiple tables. This query is created in an identical manner to the single-table query defined on the previous page. The only difference when creating a multi-table query is that after selecting the fields in one table as we saw in the last example, you then select the next table and choose additional fields.

In this query, we will ask for the name, contact type, and phone number of all records in the Contacts table. When we create the query, we will select fields from two tables: Contacts table (Last Name, First Name, and Work Phone fields) and Contacts Type table (Contact Type field).

To create a multi-table query:

  • Open the contacts management database.
  • In the database window, choose the Queries tab from the Objects palette.
  • Select the Create query by using wizard options and click Open.
  • The Simple Query Wizard opens.
  • From the Tables/Queries drop-down list, choose the first table where you would like to perform the query (e.g., Contacts).

    Tables/Queries drop-down in Simple Query Wizard
  • From the Available Fields, select the fields to be included from this table (e.g., Last Name, First Name, and Work Phone).

    Select Fields to be Included in the Query