Query Problems

crhodus

Registered User.
Local time
Today, 04:51
Joined
Mar 16, 2001
Messages
257
I have a query that I can't get to work correctly. I want to pull ALL company names from my tblCompany table. If the Company has a parent company, then I would also like to see the parent company name.

The problem is that when I run this query, it displays only companies that have a parent company record associated with it. If a company does not have a parent company associated with it then it is omitted from the query results.


SELECT tblCompany.CompanyName, tblParent.ParentName
FROM tblCompany INNER JOIN tblParent ON tblCompany.CO_NUMBER = tblParent.CO_NUMBER;

Can anyone help?

Thanks!
 
SELECT tblCompany.CompanyName, tblParent.ParentName
FROM tblCompany LEFT JOIN tblParent ON tblCompany.CO_NUMBER = tblParent.CO_NUMBER;
 
THANKS!
 

Users who are viewing this thread

Back
Top Bottom