Access outer joins?

C

Christian Meier

Hello!

I'd like to select an outer join but if I save my query access discards
the outer command?
Do anyone know why and how I can select an outer join on the same
Table??

SELECT a.*, b.F20
FROM BOSS_container AS a LEFT OUTER JOIN BOSS_container AS b ON
(a.F10=b.F10) AND (a.F2=b.F2) AND (a.F1=b.F1)
WHERE a.F5 In ('AQ','VN') And b.F5 Not In ('AQ','VN');

THX
Christian Meier
 
R

RoyVidar

Christian Meier said:
Hello!

I'd like to select an outer join but if I save my query access
discards the outer command?
Do anyone know why and how I can select an outer join on the same
Table??

SELECT a.*, b.F20
FROM BOSS_container AS a LEFT OUTER JOIN BOSS_container AS b ON
(a.F10=b.F10) AND (a.F2=b.F2) AND (a.F1=b.F1)
WHERE a.F5 In ('AQ','VN') And b.F5 Not In ('AQ','VN');

THX
Christian Meier

I don't think the keyword "OUTER" is needed. A valid left outer join,
is/can be expressed without the keyword OUTER

.... FROM a LEFT JOIN b on a.SomeField = b.SomeField ...

and should normally also work on the same table.

Observable though, is that Access/Jet doesn't barf if you use the
keyword "OUTER" in the SQL, but removes it when/if you save the query.
The result (on my setup) is the same.
 
G

Guest

Hi Christian,

Glad to see that you got it working now. When you mentioned in your original
post that the query discards the outer command, I made the assumption--which
may be incorrect--that your query also stopped working. Roy is certainly
correct that the keyword OUTER is not required.

If you want to read a related thread, where NameAutocorrupt trashed a
perfectly good SQL statement, read this thread:

http://groups.google.com/group/micr..._frm/thread/52d1339fd6c43e53/168732bc4a31fc23

I've just got in the habit of disabling this *feature* on all new databases.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 

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

Top