Datasheet
This is where (pun intended) we add the WHERE part of the SQL statement, and this is what filters the
rows and joins tables together. We've selected the
Join option allowing us to specify the primary key
(
CategoryID in the Categories table) and the foreign key (CategoryID in the Products table). The
WHERE clause becomes:
WHERE [Categories].[CategoryID] = [Products].[CategoryID]
If we wanted to add a third table, perhaps Suppliers, we could use an AND clause. Once you've
declared one
WHERE clause, the WHERE button has a different name – AND Clause as shown in
Figure 8-15:
Figure 8-15
Pressing the
AND Clause button shows the same WHERE Clause Builder, but this time you'd set the link
between the
Suppliers and Products tables as shown in Figure 8-16:
Figure 8-16
266
Chapter 8
57084_08.qxp 30/01/2004 8:03 PM Page 266