join tables using a key field

C

Cy-Burg

I want to join 2 tables by their descriptions fields. Table 1 has 10 columns
and Table 2 has 3 columns of data. I want to add the 3 columns of data from
Table 2 to Table 1 and Make a Table 4 of 13 columns of data. I have a Table
3 with a single column of key words. For instance Table 1 Description is
"big white truck" and Table 2 description is "little red truck" and the key
work is "truck" (coming from a column in Table 3). I want to write a query
that would take all fields from Table 2 and add them to Table 1 (increasing
the row by 3 fields) where the both have truck in their description.

Like statements have not been working for me. I need something like a
"contains" statment. Can anyone help? Thanks.
 
C

Cy-Burg

Cy-Burg said:
I want to join 2 tables by their descriptions fields. Table 1 has 10 columns
and Table 2 has 3 columns of data. I want to add the 3 columns of data from
Table 2 to Table 1 and Make a Table 4 of 13 columns of data. I have a Table
3 with a single column of key words. For instance Table 1 Description is
"big white truck" and Table 2 description is "little red truck" and the key
work is "truck" (coming from a column in Table 3). I want to write a query
that would take all fields from Table 2 and add them to Table 1 (increasing
the row by 3 fields) where the both have truck in their description.

Like statements have not been working for me. I need something like a
"contains" statment. Can anyone help? Thanks.
Table 1 Table 2 Table 3
big white truck little red truck truck

Table 4 (desired result)
big white truck little red truck
 
D

Dirk Goldgar

Cy-Burg said:
I want to join 2 tables by their descriptions fields. Table 1 has 10
columns
and Table 2 has 3 columns of data. I want to add the 3 columns of data
from
Table 2 to Table 1 and Make a Table 4 of 13 columns of data. I have a
Table
3 with a single column of key words. For instance Table 1 Description is
"big white truck" and Table 2 description is "little red truck" and the
key
work is "truck" (coming from a column in Table 3). I want to write a query
that would take all fields from Table 2 and add them to Table 1
(increasing
the row by 3 fields) where the both have truck in their description.

Like statements have not been working for me. I need something like a
"contains" statment. Can anyone help? Thanks.


It seems to me that you should be able to do this using the Like operator in
two non-equijoins. Have you tried SQL like this:

SELECT Table1.*, Table2.*
FROM
(Table1 INNER JOIN Table3
ON Table1.Description Like '*' & Table3.Keyword & '*')
INNER JOIN Table2
ON Table2.Description Like '*' & Table3.Keyword & '*';

That's a SELECT query, not a make-table query, but if it returns the right
information you can easily turn it into a make-table query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top