About using criteria to retrieve certain records (MDB)

Microsoft Office Access 2003

You can enter additional criteria for the same field or different fields. When you type expressions in more than one Criteria cell, Microsoft Access combines them using either the And or the Or operator. If the expressions are in different cells in the same row, Access uses the And operator, which means only the records that meet the criteria in all the cells will be returned. If the expressions are in different rows of the design grid, Access uses the Or operator, which means records that meet criteria in any of the cells will be returned.

The following examples show different ways to combine criteria with the And operator or the Or operator.

Show One field using the Or operator

Use the Or operator in one field of the design grid to retrieve certain records

Callout 1 Region is SP or RJ.

Callout 2 Access shows all company names that meet one of the criteria.

Show One field using the And operator

Use the And operator in one field of the design grid to retrieve certain records

Callout 1 Company name begins with "The" and includes the word "Box."

Callout 2 Access shows the company name that meets both criteria.

Show Two fields using the Or operator

Use the Or operator in two fields of the design grid to retrieve certain records

Callout 1 Company name begins with H or region is RJ.

Callout 2 Access shows all company names that meet the criteria for the first field or the second field.

Show Two fields using the And operator

Use the And operator in two fields of the design grid to retrieve certain records

Callout 1 Company name begins with H and region is RJ.

Callout 2 Access shows all company names that meet the criteria for the first field and the second field.

Show Three fields using the Or operator and the And operator

Use the And operator and the Or operator in three fields of the design grid to retrieve certain records

Callout 1 Company name begins with H and region is RJ ...

Callout 2 ... or region is SP and city begins with C.

Callout 3 Access shows all company names that meet the criteria for the first or second row of the design grid.

Show Where you specify criteria affects when calculations are performed

You can also specify criteria to affect the calculations and produce different query results. By adding criteria, you can limit the:

  • Groups before performing calculations on those groups.

  • Results after calculations on the groups are performed.

  • Records before they are grouped and before calculations are performed.