A "regular" inner join selects rows from the two tables where each table has
row(s) than have matching data in the join field. Say you have a list of
clients, where one client can have many invoices, but not all clients have
been issued invoices. A query like this
SELECT Clients.[Company Name], Invoices.[Invoice Number]
FROM Clients INNER JOIN Invoices ON Clients.[Client ID] = Invoices.Client;
selects clients and their matching invoices, but only those clients that
have had invoices issued.
A left join, like this
SELECT Clients.[Company Name], Invoices.[Invoice Number]
FROM Clients LEFT JOIN Invoices ON Clients.[Client ID] = Invoices.Client;
selects all clients, whether they have invoices associated with them or not,
and of course, the invoice number if they do.
A right join, like this
SELECT Clients.[Company Name], Invoices.[Invoice Number]
FROM Clients RIGHT JOIN Invoices ON Clients.[Client ID] = Invoices.Client;
does the converse: selects all invoices, even if they don't have clients
associated. These are usually orphaned records that need to be either need
to be deleted or correctly matched with existing clients.
However, don't overlook Salad's point regarding your original subquery:
subquerys do work, and sometimes (especially in deletion or update
situations) they do things that unmatched queries can't. I think the problem
with your subquery was that your table name consisted of two words ("HS
Data") and for the query to identify the table correctly, the two-word name
needs to be enclosed in brackets: [HS Data]
<ka*****@appliedtech.us> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Hey guys! The wizard in Access did end up working! I never thought I
would ever use an Access wizard. Turns out, it worked out great,
although I would have never come up with that SQL. Can you guys give
me some insight into why I needed the LEFT JOIN and the the IS NULL?
Thanks
Josh