Using the Simple Query Wizard The easiest way to create a query is with the Simple Query Wizard, which enables you to select the table fields you want to include in the query. A simple query is useful when you want to weed out extraneous fields but still want to see every record in the database table. The Simple Query Wizard helps you create a select query. Plain English Select Query The select query is used to select certain data from a table or tables. It not only filters the data, but it can also sort the data. It can even perform simple calculations on the results (such as counting and averaging). To create a select query with the Simple Query Wizard, follow these steps:
Figure 17.1. The Simple Query Wizard first asks what fields you want to include in the query. Caution Relationships Required If you're going to use two or more tables in your query, they must be joined by a relationship. See Lesson 11, "Creating Relationships Between Tables," for more information.
Figure 17.2. Queries created using the Simple Query Wizard list the data from the fields you selected. The problem with queries created using the Simple Query Wizard is that you aren't supplied with the option of setting sort parameters for the records or the capability to filter them by particular criteria. Simple queries just allow you to select the fields. For this query to provide a little more manipulation of the table data, you would have to edit this Query Design view, which is discussed in the next lesson. Building queries from scratch provides you with a lot more control over how the data is filtered, sorted, and summarized. Saving a QueryWhen you create a query, Access saves it automatically. You don't need to do anything special to save it. When you are finished viewing the results of the query, click its Close ( X ) button. The new query is then listed in the Query list that the database window provides. Rerunning a QueryAt any time, you can rerun your query. If the data has changed in the table fields that you included in a query, rerunning the query provides you with an updated set of results. To rerun a query, follow these steps:
Tip Queries Look Like Tables Queries can be manipulated in the Datasheet view just like a table. You can use the Sort and Filter features on a query, or you can delete records from the query. |
Team-Fly |
Top |