Check if string also appears in other table

Heidestrand

Registered User.
Local time
Today, 15:15
Joined
Apr 21, 2015
Messages
73
Hello,

I've a short question: I want to write a query that inner joints two tables and updates a specific column based on a description that also appears in the other table. I'm working on the WHERE part of my query here. To show you what I mean:

In table A column 1 should be updated with a value from column 1 of table B where the string or value in column 2 of table A appears or is part of a string in column 2 in table B.

Example: the string "tree house" of table A, column 2 is part of "tree house blue" in column 2 of table B, so Access should choose this value.

My problem is: How would I write it. In my case I have something like this but it doesn't work:
Code:
WHERE a.System IN (SELECT Product FROM tblSysBasisConfig WHERE Product LIKE a.System)

Then I had this solution but in this case it must be the same due to the '=' operator, otherwise it doesn't work.
Code:
WHERE a.System = b.Product

.. but I need something like a.System is part of b.Product

I hope you understand my concern and can help me :)

Thanks in advance!
 
Last edited:
Sorry for my repost, but I have the solution now

its eiter..
Code:
WHERE INSTR(b.Product, a.System) > 0

or..
Code:
WHERE b.Product LIKE "*" & a.System & "*"

Maybe I could help someone with this..
 

Users who are viewing this thread

Back
Top Bottom