Find matching data (3 tables)

HiTekRedNek

Registered User.
Local time
Yesterday, 23:33
Joined
Mar 11, 2010
Messages
18
Hi,

I have 3 seperate spreadsheets containing server information. There is a column in each of the spreadsheets with a header called hostname.

I import the 3 spreadsheets and create 3 seperate tables.
Table_A
Table_X
Table_Z

Table_A acts as my master table. I would like to run a query to find if there are any matching hostnames in Table_X OR Table_Z

I can create a join relation between either Table_A and Table_X or between Table_A and Table_Z and it will give me the results but how to I make it work by joining all 3 tables simultaneously?
 
Try using a LEFT JOIN instead of an INNER JOIN. Something like the following is a good place to start:
Code:
Select [B]Table_A.HostName As HostA, Table_X.HostName As HostX, Table_Z.HostName As HostZ[/B] 
From (([B]Table_A[/B] LEFT JOIN [B]Table_X[/B] On [B]Table_A.HostName[/B] = [B]Table_X.HostName[/B] ) LEFT JOIN [B]Table_Z[/B] On [B]Table_A.HostName[/B] = [B]Table_Z.HostName[/B] )

The resulting recordset will have all entries from Table_A matched with Table_X and Table_Z. It will also include NULL Values for any Entry that is in Table_A but is not in Table_X and Table_Z. Perhaps you can take it from there
 
Last edited:

Users who are viewing this thread

Back
Top Bottom