By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,828 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

Wildcards in a lookup table?

P: n/a
I have a query in of the form "select * from mytable where myfield is
like '*ABC*' or like '*DEF*' or like "*GHI*'".

The problem is that the list of items is growing, and I would like to
place ABC, DEF, GHI, etc., into a lookup table instead. But then how
do I do a join so that the wildcards are recognized?

TIA

Pete
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"hedrew3" <pe***@garlic.com> wrote in message
news:aa**************************@posting.google.c om...
I have a query in of the form "select * from mytable where myfield is
like '*ABC*' or like '*DEF*' or like "*GHI*'".

The problem is that the list of items is growing, and I would like to
place ABC, DEF, GHI, etc., into a lookup table instead. But then how
do I do a join so that the wildcards are recognized?


Create the query as if you were looking for an exact match. The lookup table
should include the wildcard characters. Then switch to SQL view and change the
= to a LIKE. It will look similar to...

SELECT *
FROM Table1 INNER JOIN Table2
ON Table1.SomeField Like Table2.SomeField

You cannot build or edit queries like this in the query design grid, but you can
in SQL.

Nov 12 '05 #2

P: n/a
Yep. This works so far in my testing.

Thanks,

Pete
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.