About using criteria in queries or advanced filters to retrieve certain records

About using criteria in queries or advanced filters to retrieve certain records

Criteria are restrictions you place on a query or an advanced filter to identify the specific records you want to work with. For example, instead of viewing all the suppliers that your company uses, you can view just suppliers from Japan. To do this, you specify criteria that limits the results to records whose Country field is "Japan".

To specify criteria for a field in the design grid, enter an expression in the Criteria cell for that field. The expression in the preceding example would be "Japan". You can use more complicated expressions, however, such as "Between 1000 And 5000". If your query includes linked tables, the values you specify in criteria on fields from the linked tables are case-sensitive — they must match the case of the values in the underlying table.

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, Microsoft 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, Microsoft Access uses the Or operator, which means records that meet criteria in any of the cells will be returned.

Examples of how to use multiple criteria in the design grid.

Records retrieved meet the criteria in both columns.

You can also specify criteria to affect the results of a calculation. By adding criteria, you can limit the groups for which you're performing a calculation, limit the records included in the calculation, or limit the results that are displayed after the calculation is performed. For information on where to enter criteria in a query that performs calculations, click .