Solved

Left Join makes data null?

Posted on 2016-08-02
7
62 Views
1 Endorsement
Last Modified: 2016-08-02
Doing a simple left join of two tables, I do this all the time, but today it's turning the joining table's data null.  

SELECT ThirdTier.*, ThirdOrg.Type as Type
INTO Third
FROM ThirdTier
Left JOIN ThirdOrg
ON ThirdOrg.Location=ThirdTier.SID

The data from ThirdTier is fine, the data from ThirdOrg becomes all <NULL>.

If I switch ThirdTier and ThirdOrg, the opposite happens.  ThirdOrg data is fine, ThirdTier data is all null.  WTH?!  Please help.
1
Comment
Question by:H2Omike
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 13

Assisted Solution

by:Dustin Saunders
Dustin Saunders earned 250 total points
ID: 41739964
It returns null if there's nothing joined, so something isn't lined up.  If you can post more info about the tables/columns that would be helpful.
0
 
LVL 48

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
ID: 41739966
what happens when you do a simple SELECT, without the make table?

Are you certain that ThirdTier.SID is supposed to map to ThirdOrg.Location?  Is that supposed to be LocationID?
1
 

Author Comment

by:H2Omike
ID: 41739978
If I do a select without creating the table the same thing happens.  Yes, the columns are correct, LOcation=SID.

See the table design and data snips
ThirdOrg.PNG
ThirdTier.PNG
thirdTierData.PNG
ThirdOrgData.PNG
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:H2Omike
ID: 41739982
OMG.. I figured it out....
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 41739989
Well ???
0
 

Author Comment

by:H2Omike
ID: 41739990
matching the wrong columns like an idiot.  Long day...
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 41740055
Happens to all of us, Mike.
1

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question