Bar_gold.gif 401 bytes

How to Select Certain Records from your Database

Bar_gold.gif 401 bytes


A query in Access will allow you to find records that meet certain criterion. If your database was an address list, you could list everyone who lives in Grantham. Or you could select and view out everyone who lives in OHIO or PA. You could also find everyone who is named Donald and who lives in Grantham. All these kinds of selections are handled by Queries.

How to Create a New Query


Click on Query and Create in Design View, Figure 1.
You will see a new screen Show Table.

Figure 1
Click on your database and see it appear in a window near the top of the page, Figure 2.
Figure 2
Close the Show Table window and click on the top line first row, see a button with a down arrow magically appear, Figure 3. Now you can go through this output table and select which fields will be seen when you do your query. Here's how: you click on a cell in the top row, and arrow appears, you click on the arrow and a pull down menu appears. You then select which field you want to see in this column of the table.
Figure 3

When you have finished all the fields you want to see in the output, you are ready to state your selection criterion. I chose Grantham in the City column so that only people who live in Grantham will be seen. Figure 4. This is an exclusive selection rule. Now do the query by clicking on the Button.

Figure 4


The results of Figure 4 - only people living in Grantham are listed.


And's and Or's


If you put criterion on the same line, this is an AND requirement and both conditions must be made. If you put the criterion on separate lines, they are OR's - either one of the two criterion must be satisfied. In Figure 5 see a query for all people who live in Ohio or PA.

Figure 5 - An OR query



Bar_gold.gif 401 bytes

           Return to Database Project

Bar_gold.gif 401 bytes