Re: Outer Join in MS Access
You can use both Left as well Right outer Joins in MS-Access.
This query will diaplay all records afrom Table1 and only matching records from Table 2
PHP Code:
SELECT Table1.*, Table2.* FROM Table1 LEFT JOIN Table2 ON Table1.ID = Table2.ID;
And this query will display all records from Table2 and only matching records from Table1
PHP Code:
SELECT Table1.*, Table2.* FROM Table1 RIGHT JOIN Table2 ON Table1.ID = Table2.ID;
Re: Outer Join in MS Access
Thanx Shuja Ali
I have 3 tables which I am quering and can't seem to get the join thing right. My tables are claim,addressbook and person, I need information from claim and person irregardless of whether addressbook has maching records.
This is how my select statement looks like:
SELECT c.linkno,c.agent,c.serialno,c.branch,c.subfileno,c.registeredon,(trim(p.surname) & ' ' & trim(p.initials)) AS claimant FROM (addressbook AS a RIGHT JOIN claim AS c ON a.referenceno = c.attorney) INNER JOIN [person] AS p ON c.linkno = p.linkno WHERE p.capacity = 'C'
This statement returns no records in VB, but if I query the statement in MS Access I get some records back.
How do I flag out null values co that I get some records back?
Re: Outer Join in MS Access
I have managed to sort out my join problem.
Re: Outer Join in MS Access
Quote:
Originally Posted by HappyGirl
I have managed to sort out my join problem.
That is how it should be :thumb:
Re: Outer Join in MS Access
Happygirl, Please can you share your code with me? I'm stuck with the same problem... Thanks!!
Re: Outer Join in MS Access
Quote:
Originally Posted by mrexite
Happygirl, Please can you share your code with me? I'm stuck with the same problem... Thanks!!
Do you understand that this thread is pretty old and HappyGirl has not logged on to Code guru since October 4th,2006. It is always better to ask a question rather than revoking an old thread and that a thread that is one and half year old.
Re: Outer Join in MS Access
At least he searched the forum(s) before asking the question :)
I like people who do that - they're obviously trying to help themselves BEFORE they ask the rest of us :) :thumb: :eek:
Re: Outer Join in MS Access
Quote:
Originally Posted by Twodogs
At least he searched the forum(s) before asking the question :)
I like people who do that - they're obviously trying to help themselves BEFORE they ask the rest of us :) :thumb: :eek:
Agree. And probably out of excitement of possibly finding the solution, mrexite failed to notice the date. I ran into the same experience in the past. :)