create SQL with search terms separated by spaces
Posted on 2006-11-05
I want to create a database search where the ueser types a list of works into a textfield then clicks the submit button on the form. The results page will then create an SQL which returns results that contain any of the words entered on any order. Here is my SQL right now.
WHERE item AND description LIKE '%MMColParam%'
This works but won't seperate words with spaces in between. So if the user enters "big heads" the SQL will return only the exact term "big heads" but not any entries which contain "big blah blah blah head" or just "big" or just "head".
Is there a way to make the variable (MMColParam) work to select seperate words and not the whole list of words? If you need more info please let me know. I'm using ASP VBScript.