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

Help? Need to combine lists but need instr to query substrings..

P: n/a
I'm having problems finding the syntax/comands that do the this
correctly. I'm must not be doing the join right or something..

List one
AAC1234
CDA2w31
12ZZC12
12TRE1
23234
243
....

List two
1234
A2w
C12
12TRE1

Query needs to get the substrings out. I couldn't get find the return
all the entries of list 2 in list one, but usually they are
substrings. Instr didn't work as it doesn't like static values
('1234' not list.value1)

Result
AAC1234
CDA2w31
12ZZC12
12TRE1

Suggestions?? instr is the only way I know how, but someone may have
a better approach...

Thanks,

kubie
Jul 31 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Kubie,

Easiest way is to use a query like this:

SELECT Table1.[Value1]
FROM Table1, Table2
WHERE (((Table1.[Value1]) Like "*" & [Table2].[Value2] & "*"));

All this does is look for any values in table one (List 1 in your
example) that have the string contained in table two (List 2 in your
example). This is a simplification as my example assumes one field in
each table but the comparison should be the same.

Dean...
Jul 31 '08 #2

P: n/a
On Jul 31, 4:39*pm, DeanL <deanpmlonghu...@yahoo.comwrote:
HiKubie,

Easiest way is to use a query like this:

SELECT Table1.[Value1]
FROM Table1, Table2
WHERE (((Table1.[Value1]) Like "*" & [Table2].[Value2] & "*"));

All this does is look for any values in table one (List 1 in your
example) that have the string contained in table two (List 2 in your
example). *This is a simplification as my example assumes one field in
each table but the comparison should be the same.

Dean...
Worked flawlessly.... Thank you...
Kubie
Aug 1 '08 #3

P: n/a
On Aug 1, 6:43 am, Kubie <c_ku...@yahoo.comwrote:
On Jul 31, 4:39 pm, DeanL <deanpmlonghu...@yahoo.comwrote:
HiKubie,
Easiest way is to use a query like this:
SELECT Table1.[Value1]
FROM Table1, Table2
WHERE (((Table1.[Value1]) Like "*" & [Table2].[Value2] & "*"));
All this does is look for any values in table one (List 1 in your
example) that have the string contained in table two (List 2 in your
example). This is a simplification as my example assumes one field in
each table but the comparison should be the same.
Dean...

Worked flawlessly.... Thank you...
Kubie
You're very welcome.

All the best, Dean...
Aug 1 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.