MC12
MC12

Reputation: 93

Compare data for 2 columns in access 2016

I have 2 columns where column 1 is a substring of column 2. How do I create a query in Access displaying result only when there is a match between the 2 columns? Thanks for your help!

            Column 1    Column 2
               250MG    OLBETAM CAP 250MG X 90
               250MG    OLBETAM CAP 250MG X 90
                10UG    CAVERJECT 10mcg SFDPO 2x1ml DC GB
                10UG    CAVERJECT 20mcg SFDPO 2x1ml DC GB
                10UG    CAVERJECT VIAL 10MCGS
                10UG    CAVERJECT VIAL 20MCGS

Upvotes: 1

Views: 40

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1271013

You can use instr() or like:

select t.*
from t
where column2 like "*" & column1 & "*";

Upvotes: 1

Related Questions