How to lookup on part of the word?

G

Guest

I need to look up part of a word againts a list of words.

Example:
- Table 1 contains a list of keywords:
Keyword 1 = Smith
Keyword 2 = Brice
- Table 2 contains data
Record 1 = Antonio Smith John
Record 2 = Mary Glen Smith
Record 3 = Anna Brice
- Table 3 should contain
Antonio Smith John = Smith
Mary Glen Smith = Smith
Anna Brice = Brice

Thnks in advance for your help
 
G

Guest

Try this SQL, change the names of the fields and table to yours

SELECT TableName.KeyWord, TableName1.FullName
FROM TableName, TableName1
WHERE TableName1.FullName In (Select M1.FullName From TableName1 As M1 Where
M1.FullName Like "*" & [KeyWord] & "*")
 
J

John Spencer

Alternative formulation

SELECT Table2.*
FROM Table2 INNER JOIN Table1
Try this SQL, change the names of the fields and table to yours

SELECT TableName.KeyWord, TableName1.FullName
FROM TableName, TableName1
WHERE TableName1.FullName In (Select M1.FullName From TableName1 As M1 Where
M1.FullName Like "*" & [KeyWord] & "*")

--
Good Luck
BS"D

Fonlil said:
I need to look up part of a word againts a list of words.

Example:
- Table 1 contains a list of keywords:
Keyword 1 = Smith
Keyword 2 = Brice
- Table 2 contains data
Record 1 = Antonio Smith John
Record 2 = Mary Glen Smith
Record 3 = Anna Brice
- Table 3 should contain
Antonio Smith John = Smith
Mary Glen Smith = Smith
Anna Brice = Brice

Thnks in advance for your help
 

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