Hi this is a two part problem really.
I have made a form based parameter query which uses a wild card search.
All data in the 'table' is in text format. At the moment the form has 3 parameters keyword1, keyword2 and keyword3. The sql for this is below.
SELECT column1,
FROM table
WHERE [column1] Like "*" & [Forms]![name_of_form]![keyword1] & "*"
AND [column1] Like "*" & [Forms]![name_of_form]![keyword2] & "*"
AND [column1] Like "*" & [Forms]![name_of_form]![keyword3] & "*";
As you can see the parameter query works fine with 'AND' so I can enter 1 keyword and get all the records that contain that keyword or I can enter 2 or 3 keywords and get all the records that must contain those 2 or 3 keywords.
What I also want is to have 3 more keywords on the form where the results will have records with either keyword 1 or keyword 2 or keyword 3.
I have tried using 'OR' in a new query based on the one above but it just returns all records.
part 2 of question is how I can adapt the query above to search in 2 or more columns rather than just the one as it is at the moment.
Thanks
I have made a form based parameter query which uses a wild card search.
All data in the 'table' is in text format. At the moment the form has 3 parameters keyword1, keyword2 and keyword3. The sql for this is below.
SELECT column1,
FROM table
WHERE [column1] Like "*" & [Forms]![name_of_form]![keyword1] & "*"
AND [column1] Like "*" & [Forms]![name_of_form]![keyword2] & "*"
AND [column1] Like "*" & [Forms]![name_of_form]![keyword3] & "*";
As you can see the parameter query works fine with 'AND' so I can enter 1 keyword and get all the records that contain that keyword or I can enter 2 or 3 keywords and get all the records that must contain those 2 or 3 keywords.
What I also want is to have 3 more keywords on the form where the results will have records with either keyword 1 or keyword 2 or keyword 3.
I have tried using 'OR' in a new query based on the one above but it just returns all records.
part 2 of question is how I can adapt the query above to search in 2 or more columns rather than just the one as it is at the moment.
Thanks