Entering Multiple Criteria with the OR Operator


graphics/06inf14.jpg

graphics/one_icon.jpg

After you've displayed the query for which you want to enter criteria in Design view, click the cell in the Criteria row for the field you want to match, and type your first criterion (here, IN ).

graphics/two_icon.jpg

Click in the or row in the same column, and type the second value you want to match (in this case, KY ).

graphics/three_icon.jpg

Click the Save button on the Standard toolbar in the main Access window to save the query design.

graphics/four_icon.jpg

Click the Run button to run the query.

INTRODUCTION

There may be times when you want to match more than one criteria. For instance, you might want to list all clients who live in Indiana, as well as those clients who live in Kentucky, as outlined here. To do so, you use the OR operator.

TIP

Quotation Marks

Access will automatically add quotation marks around your entry. You'll see these if you move to another field or open the query.

graphics/06inf15.jpg

graphics/five_icon.jpg

Access runs the query and displays a table containing only those records that match the criteria you entered (in this case, clients in Indiana or Kentucky).

graphics/six_icon.jpg

Click the Close button to close the query window.

TIP

OR Queries

This type of query is sometimes called an OR query because the data in the selected table can match either the first criteria or the second criteria to be included in the results.



Easy Microsoft Office Access 2003
Easy Microsoft Office Access 2003
ISBN: 789729598
EAN: N/A
Year: 2003
Pages: 174

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net