How to Create a Query in Access 2013

Select CREATE > Query Design from the Ribbon toolbar. Choose tables. Choose fields. Adjust criteria. Run.

To create a new query in Access, select Query Design from the CREATE tab.

Screenshot of the Microsoft Access CREATE tab

You can also use the Query Wizard to build a query, but these steps are for creating a query without using the Query Wizard.

The Show Table dialog will appear. Here, you select the tables that you want to use in your query.

Screenshot of the Show Table dialog

You can also select the Queries tab or Both tab to include another query in your query.

After selecting the tables (and/or queries) to your query and closing the dialog, you will see a graphical display of the objects you chose.

Here you can choose which tables and fields are displayed to the user when the query is run. You can also provide extra criteria (under Criteria). In this example, no criteria has been specified.

Screenshot of the Show Table dialog

Run the query by using the Run button.

Screenshot of the Run button

Switching to Datasheet view will also run the query.

The results of the query will be shown in Datasheet view. In this case, results from both tables (Customers and Products) are displayed (because we left Show checked). Also, all records are being displayed, because we didn't provide any criteria with which to narrow down the results.

Screenshot of the query results

You can save the query to the database so that you can run it whenever you need to. The results of the query will change over time as the tables are populated with more and more data.

Screenshot of the Save button

The following example uses the same query, but this time we've added some criteria to the Criteria row. We've added >80000 to the Price field.

Screenshot of the new criteria

Now when we run the query, we only see records that match the new criteria (where the price is greater than $80,000).

Screenshot of the results using the new criteria

The "Totals" Option

You can use the Totals option to calculate the sum from a number of records.

In the following example, we use it to calculate the total price from all purchases from a given customer.

To bring up the Totals row, click the Totals icon in the Ribbon.

Screenshot of the Totals icon

This adds a row called Totals to the query builder. We use Sum for the Price field and Group By for the rest.

In this example we are also specifying that the results should be sorted in descending order.

Screenshot of the query builder

Now when the query is run, the results are slightly different.

Screenshot of the query results