sj1187534
Well-known member
Hi...I have a search engine that includes "search by location" functionality. The problem is when the user selects more than one from the listbox of locations, I have no way of searching those selected values in the database. Thats because, a single user in the database table has his desired locations as a string of locations from the locations listbox....
ex...in the database table, lets the user has his desired locations as Dallas, NewYork, Boston.
Now, in the search engine , if the search in locations are selected as Dallas and Boston (passes to the SQl server as "Dallas,Boston"), how do I pass this in the SQL query???
I cant use the "charindex" as it can only check the whole "dallas,boston" string and not a part of it......
I cant use the "like" keyword also because the order of the words matters here...
I hope you understand what I am talking about. Any help would be really appreciated...
Thanks,
~SJ
ex...in the database table, lets the user has his desired locations as Dallas, NewYork, Boston.
Now, in the search engine , if the search in locations are selected as Dallas and Boston (passes to the SQl server as "Dallas,Boston"), how do I pass this in the SQL query???
I cant use the "charindex" as it can only check the whole "dallas,boston" string and not a part of it......
I cant use the "like" keyword also because the order of the words matters here...
I hope you understand what I am talking about. Any help would be really appreciated...
Thanks,
~SJ