A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Full Outer Join Question



 
 
Thread Tools Display Modes
  #1  
Old May 6th, 2010, 05:37 PM posted to microsoft.public.access.queries
Barb Reinhardt
external usenet poster
 
Posts: 1,381
Default Full Outer Join Question

I'm trying to do a full outer join between the tables PS and Verification. I
want to join the fields titled "Non-Empl ID" in both tables. What syntax do
I need? I've tried several with no success. I want to retain the
non-matches between both tables as well.

Thanks

Barb Reinhardt

  #2  
Old May 6th, 2010, 06:08 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Full Outer Join Question

Barb Reinhardt wrote:

I'm trying to do a full outer join between the tables PS and Verification. I
want to join the fields titled "Non-Empl ID" in both tables. What syntax do
I need? I've tried several with no success. I want to retain the
non-matches between both tables as well.


SELECT PS.*, Verification.*
FROM PS LEFT JOIN Verification
ON PS.[Non-Empl ID] = Verification.[Non-Empl ID]
UNION ALL
SELECT PS.*, Verification.*
FROM PS RIGHT JOIN Verification
ON PS.[Non-Empl ID] = Verification.[Non-Empl ID]
WHERE PS.[Non-Empl ID] Is Null

--
Marsh
MVP [MS Access]
  #3  
Old May 6th, 2010, 08:54 PM posted to microsoft.public.access.queries
Barb Reinhardt
external usenet poster
 
Posts: 1,381
Default Full Outer Join Question

Thank you so much. Do I need the [ ] around column names that have spaces
in them (much like I need ' ' in Excel for worksheets with spaces) ?

Barb Reinhardt



"Marshall Barton" wrote:

Barb Reinhardt wrote:

I'm trying to do a full outer join between the tables PS and Verification. I
want to join the fields titled "Non-Empl ID" in both tables. What syntax do
I need? I've tried several with no success. I want to retain the
non-matches between both tables as well.


SELECT PS.*, Verification.*
FROM PS LEFT JOIN Verification
ON PS.[Non-Empl ID] = Verification.[Non-Empl ID]
UNION ALL
SELECT PS.*, Verification.*
FROM PS RIGHT JOIN Verification
ON PS.[Non-Empl ID] = Verification.[Non-Empl ID]
WHERE PS.[Non-Empl ID] Is Null

--
Marsh
MVP [MS Access]
.

  #4  
Old May 6th, 2010, 09:22 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Full Outer Join Question

Yes you need the square brackets for any field or table names that have any
characters in the names other than Letters, Numbers (with a least a leading
letter), and the underscore.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Barb Reinhardt wrote:
Thank you so much. Do I need the [ ] around column names that have spaces
in them (much like I need ' ' in Excel for worksheets with spaces) ?

Barb Reinhardt



"Marshall Barton" wrote:

Barb Reinhardt wrote:

I'm trying to do a full outer join between the tables PS and Verification. I
want to join the fields titled "Non-Empl ID" in both tables. What syntax do
I need? I've tried several with no success. I want to retain the
non-matches between both tables as well.

SELECT PS.*, Verification.*
FROM PS LEFT JOIN Verification
ON PS.[Non-Empl ID] = Verification.[Non-Empl ID]
UNION ALL
SELECT PS.*, Verification.*
FROM PS RIGHT JOIN Verification
ON PS.[Non-Empl ID] = Verification.[Non-Empl ID]
WHERE PS.[Non-Empl ID] Is Null

--
Marsh
MVP [MS Access]
.

  #5  
Old May 6th, 2010, 09:29 PM posted to microsoft.public.access.queries
Petr Danes[_3_]
external usenet poster
 
Posts: 52
Default Full Outer Join Question

You may need brackets if you have foreign characters in your field names and
you definitely need them if you have spaces, which is why many people
recommend that such names not be used. If your names are well-behaved, from
only the US alphabet, you do not need brackets.

Pete



"Barb Reinhardt" pÃ*Å¡e v diskusnÃ*m
pÅ™Ã*spÄ›vku ...
Thank you so much. Do I need the [ ] around column names that have
spaces
in them (much like I need ' ' in Excel for worksheets with spaces) ?

Barb Reinhardt



"Marshall Barton" wrote:

Barb Reinhardt wrote:

I'm trying to do a full outer join between the tables PS and
Verification. I
want to join the fields titled "Non-Empl ID" in both tables. What
syntax do
I need? I've tried several with no success. I want to retain the
non-matches between both tables as well.


SELECT PS.*, Verification.*
FROM PS LEFT JOIN Verification
ON PS.[Non-Empl ID] = Verification.[Non-Empl ID]
UNION ALL
SELECT PS.*, Verification.*
FROM PS RIGHT JOIN Verification
ON PS.[Non-Empl ID] = Verification.[Non-Empl ID]
WHERE PS.[Non-Empl ID] Is Null

--
Marsh
MVP [MS Access]
.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.