Left Outer Join

G

Guest

Hello:
How can I make this query a Left Outer Join? I want all institution names
from the institution table and only the institutions from the History table
that have a previous name. Thanks J.
Select DistinctRow [Institution name], [Institution id], [Corporation id]
from [Institution table]
UNION Select [previous name], [Institution id], [Corporation id] from
[History table]
ORDER BY [Institution name];
 
K

Ken Snell \(MVP\)

Try this:

SELECT DistinctRow T.[Institution name], T.[Institution id],
T.[Corporation id], H.[previous name]
FROM [Institution table] AS T LEFT JOIN
[History table] AS H
ON T.[Institution id] = H.[Institution id]
ORDER BY T.[Institution name];
 
G

Guest

That worked perfectly. Thanks for your help, Ken
Jackie.

Ken Snell (MVP) said:
Try this:

SELECT DistinctRow T.[Institution name], T.[Institution id],
T.[Corporation id], H.[previous name]
FROM [Institution table] AS T LEFT JOIN
[History table] AS H
ON T.[Institution id] = H.[Institution id]
ORDER BY T.[Institution name];

--

Ken Snell
<MS ACCESS MVP>


Jade5 said:
Hello:
How can I make this query a Left Outer Join? I want all institution names
from the institution table and only the institutions from the History
table
that have a previous name. Thanks J.
Select DistinctRow [Institution name], [Institution id], [Corporation id]
from [Institution table]
UNION Select [previous name], [Institution id], [Corporation id] from
[History table]
ORDER BY [Institution name];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Combo box/Forms 1
Macro isn't working 3
Left outer join 10
Vurtual Subform 4
open a second form with DAO 2
Combo box selection opens form 1
Problem joining queries 5
selecting a query from a combo box 1

Top