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?
 
Ashok KumarConnect With a Mentor Commented:
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
 
Ashish PatelConnect With a Mentor Commented:
query looks good. What error do you get?
0
 
fredphuaAuthor Commented:
I got no result.

Yes, I did use the single quotes (LIKE '%MMColParam%') but DW CS3 automatically removed it. Strange.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Ashok KumarConnect With a Mentor Commented:
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 BOUDJAKDJIConnect With a Mentor Database 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
All Courses

From novice to tech pro — start learning today.