Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Table within Tables 1

Status
Not open for further replies.

porto99

Technical User
Nov 1, 2004
96
GB
I need to run a query that will transverse though three tables.

Table1 -> Table2 -> Table3

I need to display serveral fields from Table1 together with items from Table 2 and Table3. A primary key in each table links the tables together.

e.g.
T1_Item1 T1_Item2 T2_Item1 T2_Item2 T2_Item3 T3_Item1 T3_Item2 T3_Item3.

The 1st table is a list of messages, the 2nd a list of words in each message and the 3rd table a list of fields in each word.

All the Queryies I have done so far just product a large flat table, so is VBA required?
 
SELECT Table1.Item1 AS T1_Item1, Table1.Item2 AS T1_ITEM2, Table2.Item1 AS T2_Item1, Table2.Item2 AS T2_Item2, Table2.Item3 AS T2_Item3, Table3.Item1 AS T3_Item1, Table3.Item2 AS T3_Item2, Table3.Item3 AS T3_Item3
FROM (Table1 INNER JOIN Table2 ON Table1.key = Table2.key) INNER JOIN Table3 ON Table2.key = Table3.key;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top