sub query

F

franky

I have a table called tblItems with a "itemDesc" text field. I aso have a
table called tblExcludeTheseWords. This table contains a list of words that
I would like to compare against the itemDesc field in tblItems and exclude
these records if a match is found in ANY part of itemDesc. How would I
accomplish this? I was trying somthing like this but its not working:

Select itemDesc from tblItems where itemDesc NOT IN (Select "ExcludeText"
from tblExcludeTheseWords)

Thanks in Advance!
 
J

John Spencer

This sounds like a case for a non-equi join.

SELECT Distinct ItemDesc
FROM tblItems LEFT JOIN tblExcludeTheseWords
ON tblItems.ItemDesc LIKE "*" & tblExcludeTheseWords.ExcludeText & "*"
WHERE tblExcludeTheseWords.ExcludeText is Null
 
Top