 |
 |
|
|
 |
|
 |
 |
 |
College Textbooks
Gleason Associates
Microsoft Access textbook for Glencoe/McGraw-Hill

In 1997, book packager Gleason Associates asked me to be development editor for a Microsoft Access 95 textbook they were creating for Glencoe/McGraw-Hill. As development editor, I modified the outline provided by the author, wrote much of the text, created accompanying screenshots, and provided a glossary of terms. I was development editor for both Access 97 and Access 2000 editions as well.

ADDING QUERIES TO A DATABASE
Objectives
After completing this lesson, you will be able to:
- Create a query in Design View.
- Make changes to the dynaset.
- Modify a query.
- Specify selection criteria in a query.
- Use AND and OR criteria.
- Use the Top Values property.
- Add an expression to a query.
Estimated time: 1 hour
Queries answer questions about the information in a database. Suppose you had a database of baseball players with all their statistics. You could use a query to learn which batters hit more than 20 home runs. You could refine your query and ask a more specific question, like "Who on the Atlanta Braves hit more than 20 homers and at least 30 doubles?" In the same way, a store manager uses queries to find which products sell best and which are most profitable. So queries change a database from mere rows of records into a dynamic information resource. They can help manage a business, run a hospital, send spaceships to Mars – or settle a baseball argument.
Queries resemble filters. Both allow you to select certain fields, sort records, and specify criteria to find the information you need. But a filter is a temporary snapshot of selected data. A query is more permanent. Queries, like tables or forms, are objects, and have their own tab in the Database window. You can save a query and name it. You can also use it as the source of records for a report.
Objective 1
Creating a Query in Design View
When you design a query, you're giving Access a road map for searching through a database and finding the records that answer your question. You can use a wizard to design some types of queries, but often it's better and easier to create a query from scratch in Design View. On the lower pane of the Query Design window is the design grid. Here you enter the directions Access needs to find your records.
Note: The design grid is sometimes called the QBE (Query By Example) grid, which was its name in previous versions of Access.
After you design a query, switch to Datasheet View to see the results. Access searches for records according to the instructions you gave it on the design grid. These resulting records are called a dynaset, which looks just like a table.
|
|
 |
 |
|
 |
 |
|
 |
|