You are on page 1of 10

Microsoft Access - query

After creating one or more tables in a database and populating it (them) with values, one of the next steps you
would take is to examine or analyze the values in the database. Analyzing the values in a table is also referred to as
querying. Microsoft Access -query

Answer:Select the Create tab in the toolbar at the top of the screen. Then click on the Query Design button under
the Other group.

Next, highlight the tables that you wish to use in the query. In this example, we've selected the Employees table and
clicked on the Add button. When you are done selecting the tables, click on the Close button.

Add the fields to the query. You can do this by double-clicking on the field name. In this example, we've added the
LastName, FirstName, and Address fields.
Then click on the Save button at the top left of the window (this is the button with the picture of the disk).

The Save As window should appear. Enter the name that you'd like to assign to the query and click on the OK
button. In this example, we've saved the query as Query1.

You should now see the query appear in the left window.

Query criteria
A criterion is similar to a formula it is a string that may consist of field references, operators, and constants.
Query criteria are also referred to as expressions in Microsoft Office Access 2007.
The following tables shows some sample criteria and explains how they work.
Criteria
>25 and <50
DateDiff ("yyyy",
[BirthDate], Date()) >
30
Is Null

Description
This criterion applies to a Number field, such as Price or UnitsInStock. It includes only
those records where the Price or UnitsInStock field contains a value greater than 25 and
less than 50.
This criterion applies to a Date/Time field, such as BirthDate. Only records where the
number of years between a person's birthdate and today's date is greater than 30 are
included in the query result.
This criterion can be applied to any type of field to show records where the field value is
null.

You might also like