How to Create a Query in Microsoft Access

A query shows only the records and fields you ask for, such as all candidates from Kerala sorted by name. To create a query in Access, use Create › Query Design, add a table, choose fields and type criteria.

Most common typeSelect query
ToolsQuery Wizard, Query Design
Works inAccess 2010 and later, Microsoft 365 (Windows)

Step 1: Open Query Design

  1. Go to Create › Query Design.
  2. In the Add Tables pane, double-click the table you want, for example Candidate Details, and close the pane.

Step 2: Choose the fields

Double-click the fields you want to see. Each one appears as a column in the grid at the bottom. Double-click * to include every field.

Step 3: Add criteria

Type conditions in the Criteria row under a field:

To show Criteria
State is Kerala "Kerala"
Age 30 or more >=30
Born in 2000 or later >=#01/01/2000#
Name starts with A Like "A*"
City is Kochi or Thrissur "Kochi" Or "Thrissur"
Email is missing Is Null

Criteria on the same row are joined with AND; criteria on the or row below are joined with OR.

Step 4: Sort and run

  1. In the Sort row, choose Ascending or Descending.
  2. Click Run (the red exclamation mark) to see the results.
  3. Save the query with Ctrl + S. It runs again on the latest data every time you open it.

Ask for a value each time

Type a prompt in square brackets in the Criteria row, for example [Enter state]. When the query runs, Access asks for the state and shows only those records.

Count and total with a query

Click Totals on the Query Design tab. A Total row appears: set it to Group By for State and Count for Registration ID to count candidates in each state.

FAQ

What is the difference between a query and a filter?

A filter is temporary. A query is saved and can be reused, used in a form or report, or exported to Excel.

Does a query store data?

No. A select query shows data from tables each time it runs; the data stays in the tables.

Can I use a query in Excel?

Yes. In Excel, use Data › Get Data › From Database › From Microsoft Access Database and pick the query.

Related

Last updated · Written by Ajay Anand, Microsoft Excel MVP