Multiple LIKE Condition

Can anyone advise how to create a query using two sets of "LIKE %%" conditions? I tried tbe below query statement but failed.

SELECT *
FROM dbo.coy_free_listing
WHERE coy_free_list_publish = 'Yes' AND coy_free_list_admin_publish = 'Yes'  AND (coy_free_list_cse_subcat LIKE %MMColParam%) AND (coy_free_list_region LIKE %MMCountry%)
ORDER BY coy_free_list_id ASC

I am using DW CS3 for development.
fredphuaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ashish PatelCommented:
query looks good. What error do you get?
0
Ashok KumarCommented:
SELECT *
FROM dbo.coy_free_listing
WHERE coy_free_list_publish = 'Yes' AND coy_free_list_admin_publish = 'Yes'  AND (coy_free_list_cse_subcat LIKE '%MMColParam%') AND (coy_free_list_region LIKE '%MMCountry%')
ORDER BY coy_free_list_id ASC
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fredphuaAuthor Commented:
I got no result.

Yes, I did use the single quotes (LIKE '%MMColParam%') but DW CS3 automatically removed it. Strange.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Ashok KumarCommented:
Just check in your management studio whether this query result return any rows, if it does then pblm with DW CS3, else there should be pblm with data conditions matching.
0
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
What is the collation of the database.  Make sure it is case insensitive else the case will matter...
0
fredphuaAuthor Commented:
Thanks guys! I fixed it!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.