How to lookup on part of the word?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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] & "*")
 
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
 
Back
Top