Microsoft Office Tutorials and References
In Depth Information
As you read this chapter, you will learn how to query a database by performing these
• Create queries using the Simple Query Wizard and Design view
• Use criteria in queries
• Create and use parameter queries
• Sort data in queries
• Join tables in queries
• Perform calculations in queries
• Create crosstab queries
Query Design Guidelines
When posing a question to Access, you must design an appropriate query. In the process of
designing a query, the decisions you make will determine the ﬁ elds, tables, criteria, order,
and special calculations included in the query. To design a query, you should follow these
1. Identify the ﬁ elds. Examine the question or request to determine which ﬁ elds from the
tables in the database are involved. Examine the contents of these ﬁ elds to make sure
you understand how the data is stored.
2. Identify restrictions. Unless the question or request calls for all records, determine the
restrictions, that is, the conditions records must satisfy in order to be included in the results.
3. Determine whether special order is required. Examine the question or request to
determine whether the results must appear in some speciﬁ c order.
4. Determine whether more than one table is required. If all the ﬁ elds identiﬁ ed in Step 1
are in the same table, no special action is required. If this is not the case, identify all tables
represented by those ﬁ elds.
5. Determine whether calculations are required. Examine the question or request to
determine whether, in addition to the ﬁ elds determined in Step 1, calculations must be
included. Results of mathematical operations typically are not stored in the database
because they can be calculated easily when necessary. Such calculations include individual
record calculations (for example, adding the values in two ﬁ elds) or group calculations
(for example, ﬁ nding the total of the values in a particular ﬁ eld on all the records).
6. If data is to be summarized, determine whether a crosstab query would be appropriate.
If data is to be grouped by two different types of information, you can use a crosstab
query. You will need to identify the two types of information. One of the types will form
the row headings and the other will form the column headings in the query results.
When necessary, more speciﬁ c details concerning the above decisions and/or actions are
presented at appropriate points in the chapter.