I have multiple (3+) Excel tables (only first row is given for presentation purpose for first 3 tables). What I am trying to achive is to show all rows from all the tables, and join them where a common value exists, i.e. I am trying to simulate FULL OUTER JOIN.
TBL1
IDno IDname d10 d30 datecreated
12-778 Robetrt 62 72 9/25/2020
TBL2
IDno IDname result3 datecreated
12-124 Sam2 text22 9/25/2018
TBL3
IDno IDname Area datecreated
12-324 Trinton 6.25 9/25/2013
Sometimes IDno between diferent tables are the same but in the majority of cases they are different.
I made a UNION
query to return all the IDno from the tables:
SELECT TBL1.IDno, TBL1.IDname FROM TBL1 UNION SELECT TBL2.IDno, TBL2.IDname FROM TBL2 UNION SELECT TBL3.IDno, TBL3.IDname FROM TBL3;
I named the query IDs
. Then, I would like to get a table which would show all the rows and also combine the rows where the IDno is the same:
RESULT
IDno IDname d10 d30 result3 Area
I used:
SELECT
IDs.IDno, IDs.IDname,
TBL1.d10, TBL1.d30,
TBL2.result3,
TBL3.Area
FROM ((IDs
left join TBL1 on IDs.IDno = TBL1.IDno)
left join TBL2 on TBL1.IDno = TBL2.IDno)
left join TBL3 on TBL1.IDno = TBL3.IDno
UNION
SELECT
IDs.IDno, IDs.IDname,
TBL1.d10, TBL1.d30,
TBL2.result3,
TBL3.Area
FROM ((IDs
right join TBL1 on IDs.IDno = TBL1.IDno)
right join TBL2 on TBL1.IDno = TBL2.IDno)
right join TBL3 on TBL1.IDno = TBL3.IDno
WHERE
IDs.IDno IS NULL;
The end result is LEFT JOINed tables with some additional rows that show IDno and IDname but no data from TBL2 or TBL3. I cannot figure out how to UNION
left and right JOIN to achive FULL OUTER JOIN in this case. It works with 2 tables but not three or more in Acess. Is there a way to join multiple tables in Excel (Power query) or elsewhere without the need for SQL server?