Microsoft Access 2010 Bible

(Rick Simeone) #1

Part I: Access Building Blocks


170


FIGURE 4.33

A Cartesian product recordset


In virtually every instance, the data returned by a Cartesian product query is worthless. Because
data is duplicated for every row in both tables, there is no useful information that can be derived
from the query.

Summary


This chapter has taken on the major topic of building select queries. Without a doubt, query cre-
ation is a daunting task, and one that takes a lot of practice. Even simple queries can return unex-
pected results, depending on the characteristics of the join between tables, and the criteria used to
filter data in the underlying tables.

Queries are an integral and important part of any Access database application. Queries drive forms,
reports, and many other aspects of Access applications.

Users always assume the data they see in a form or report is correct. Most often, data in a form or
report is provided by a query. As you read in this chapter, it’s quite easy to produce a query that
returns only part of the data expected by users, or transforms data in unpredictable ways. You
should always carefully test your queries and verify that they’re working as expected.

Your best bet for mastering Access queries is to try increasingly difficult queries, and to always
check your work. In the case of improperly joined tables, Access queries almost always under-
report the data in the tables. You’ll discover the missing records only by carefully examining the
data to ensure that your query is working properly.
Free download pdf