Link to home
Start Free TrialLog in
Avatar of peispud
peispudFlag for Canada

asked on

Select statement with exact match on record field with multiple items (comma delimited)

In my table, I have a field [tbl Eqp Filters].[Eqp Type]           {string}

In one of the records, the field contains the following data.    
[tbl Eqp Filters].[Eqp Type]   =    TT50-SR12 , TT50-SR12fe

Open in new window

I would like a select statement that could find this record to match on exact matches on this list.

if  strEQPType  = "TT50-SR1" ,  no records would be found.

if strEQPType  = "TT50-SR12 "  then the record the record is found.


The code below not work correctly.

Set rs = dbs.OpenRecordset("Select * from [tbl Eqp Filters] where [EQP Type] like '" & strEQPType & "'")

Any help would be appreciated.
Thank you.
SOLUTION
Avatar of bfuchs
bfuchs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of peispud

ASKER

I tried this,  It did not work for me.
what do you mean didnt work?
Avatar of peispud

ASKER

HI.

The attachment is a small Microsoft Access database to demonstrate the problem.

I've included the SQL select statement statement that you provided in the code as part of  the application.

The database has one record.   The [Eqp Type] value for this record is
TT50-SR12 , TT50-SR12fe

Open in new window


Using the code provided,  I cannot find the record where [Eqp Type] contains "TT50-SR12"
Test-SQL.accdb
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial