Multiple Table Query

  • Thread starter Thread starter GaryLancs
  • Start date Start date
G

GaryLancs

I have 3 main data tables, Table 1 “SR”, Table 2 “CN” and
Table 3 “NMPI”, and they have been linked so

Table1 “SR” ---- Table 4 “SR&NMPI”----Table 3”NMPI”----
Table 5 “CN&NMPI”----Table 2 “CN”

Tables 4 & 5 have been created so I can have multiple data
entries. All tables have unique ID keys.

My Table 3”NMPI” is the main cost table, which has linked
records to either Tables 1 & 2 or in some cases both.

I would like to create a query that is based on all
records from Table 3, which have related records in Tables
1 and/or 2. But show all records even though there will be
null values in either Tables 1 and 2.

Thanks
 
Hi,



SELECT whatever
FROM (table3 LEFT JOIN table1 ON table3.id=table1.id)
LEFT JOIN table2 ON table3.id = table2.id




should do.


hoping it may help,
Vanderghast, Access MVP


I have 3 main data tables, Table 1 “SR”, Table 2
“CN” and
Table 3 “NMPI”, and they have been linked so

Table1 “SR” ---- Table 4 “SR&NMPI”----Table
3”NMPI”----
Table 5 “CN&NMPI”----Table 2 “CN”

Tables 4 & 5 have been created so I can have multiple data
entries. All tables have unique ID keys.

My Table 3”NMPI” is the main cost table, which has linked
records to either Tables 1 & 2 or in some cases both.

I would like to create a query that is based on all
records from Table 3, which have related records in Tables
1 and/or 2. But show all records even though there will be
null values in either Tables 1 and 2.

Thanks
 
Back
Top