Page 2 of 13PREVNEXT

Queries VII: Query multiple sources for data

Joins combine data from two sources into one result

Join the fields, get the results.

For this course, pretend your boss needs to know which products have sold, who sold them, and when. To find that data, you'll need to query at least three of the tables in your database — Products, Orders, and Employees.

Building a multi-source query is a lot like creating any other select query. You start by choosing a record source and identifying the fields you want to see in your results. But as part of that process, you also need to make sure the tables or queries in your record source can participate in a join. A join is an association between a field in one source, and a field with a compatible data type in another. Joins tell Access how to relate the data in each source.

As an example, look at the picture. The join associates orders with employees, and provides part of the data you need to answer your boss's questions about sales.

For a multi-source query, joins are essential. Without a join, your query returns all the data from each table, a result called a Cartesian Product, and that isn't very useful. The rest of this course teaches you the rules for using joins, and shows you how to create multi-source queries that use the most common types of joins.

Page 2 of 13PREVNEXT