Lesson 19ª

 

 

 

 

 

   

Queries III:

For this lesson, I have changed some of the information in our telephone guide for the next examples. We can perform another Query on this Query. For example, everyone living in a ZIP code outside 12347... However, we could have better result by performing 2 Queries at the same time.

Access allows us to perform Queries with multiple criteria simply. We just need to write the search criteria we want to combine in each column.

And the result will be:

We might want to view the rest of the fields. A way is to assign them one by one in each column, as we have learned previously. However, Access has a simpler way: using the star value " * ".

To do this, we need to introduce the criteria manually for the fields we want specified. Then, in the last column, in the "field" row, we select the value "Telephone guide 1.*". Be careful, if we select the option see the entire table "Telephone guide 1.*", we would have to remove (unselect) the slots for "Show" for the rest of the fields not to be duplicated.

This will be the result:

We are seeing the advantages of Access little by little. The true dimension of Queries is obtained through operators. These are the operators: equal ("="), greater than (">") , lower than ("<"). And finally, there are three logical operators: no ("Not"), and ("And"), or ("Or").

We have learned how to perform multiple Queries. Let's combine these with our operators to make an example. We want to find out the people that live in the ZIP code 45555 or higher in London, but we are not interested in those whose name is "Jessica". Once again, I have altered the data in our telephone guide for this example.

Our Query would look like this: