linking fields which are blank

MetLife

Active Member
Joined
Jul 2, 2012
Messages
311
Office Version
  1. 365
Hi,

I linked two tables with a "join" and the resulting table excludes the record if the value in both table A and table B is blank.

At least this is what it appears to be doing.

Is there a way around this (to include the record) because in this case the fields are the same but they are blank.

Thanks
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You cannot join on a blank field in any database program.
Fields that you are joining on really should not have any blanks.

You can do LEFT or RIGHT joins, which will include ALL records from one of the tables, and all matches from the other. So it would show the blanks from the one table. But that will not return/join blank fields from the other table to that.
 
Upvote 0
OK thanks for that clarification

If you get blank data, do you normally fill it with "NA" using a macro then? The query will not work with LEFT or RIGHT joins because the fields have to match exactly.

Thanks
 
Upvote 0
when I use a LEFT or RIGHT join, I get the error message - the sql statement could not be executed because it contains ambiguous outer joins. To force one of the joins to be performed first, create a separeate query that performs the first join and then include that query in your sql statement.
 
Upvote 0
It all depends on what has to happen (what you are trying to do with it).
Note that if you have multiple blanks in one file, filling them with the same value with create one-to-many or many-to-many relationships. That could be problematic, depending on what you want to do (your query could return more records than are found in either table).

Doesn't some sort of determination need to be make which records from table A should match up to which records in table B?
 
Upvote 0
Post some sample data of what you have in the tables that you are trying to join.
 
Upvote 0
What is supposed to happen, is that the columns represent a unique lookup key. So table A is assets and table B is liabilities and they have to match up using several columns from A and B. I think this is a one to one relationship.

This was done in matlab, where the key values were combined with a separator "|" between them to create a lookup key.
 
Upvote 0
You can join two tables on one field or multiple fields. However, none of the fields you are joining on should contain any blanks. That will create problems.
 
Upvote 0

Forum statistics

Threads
1,221,700
Messages
6,161,371
Members
451,700
Latest member
Eccymarge

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top