Searching a field using a list of words in a table

B

Booost

Im trying to search a field to find if it contains a word from a list i
have that has about 1000 entries in a table.

I can do single word searches with the instr and like but etc, but i
cant figure out how to use the instring search with a list of words
from a table.

Any ideas out there ?
 
P

pietlinden

Booost said:
Im trying to search a field to find if it contains a word from a list i
have that has about 1000 entries in a table.

I can do single word searches with the instr and like but etc, but i
cant figure out how to use the instring search with a list of words
from a table.

Any ideas out there ?

create a deliberate cartesian product between the two tables and then
use InStr?
just a crackhead thought...
 
D

Duane Hookom

To add to this, you can use Like such as

SELECT *, [Word]
FROM tblNoName, tblWords
WHERE [a field] Like "*" & [Word] & "*";
 
A

Allen Browne

1. Create a query using both your main table and also your table of
keywords. The must be no line joining the 2 tables in the upper pane of
query design.

2. In the Criteria row under the field that contains the words, enter:
Like "*" & [tblKeyword].[Keyword] & "*"
substituting the name of the table and field in your table of keywords.

3. In the Properties box, set the Unique Records property to Yes, so the
record is not duplicated when it matches multiple keywords.

The results will be read-only.
 
J

John Vinson

Im trying to search a field to find if it contains a word from a list i
have that has about 1000 entries in a table.

I can do single word searches with the instr and like but etc, but i
cant figure out how to use the instring search with a list of words
from a table.

Any ideas out there ?

You can actually do a non-equi join in a (non-updateable) Cartesian
query:

SELECT <whatever>
FROM yourtable, wordlist
WHERE yourtable.textfield LIKE "*" & wordlist.word & "*";


John W. Vinson[MVP]
 
Top