Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2012
    Posts
    11

    Unanswered: Multi Criteria search in the same field ?

    Is it possible to search for at least 2 criteria within the same field? Please see attachment. Currently I search for the first 11 characters of a class call Intensive Reading, but I also want to include the Reading class without Intensive. How can I proceed ?

    Thank you
    Attached Thumbnails Attached Thumbnails Capture.JPG  

  2. #2
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    You can combine several conditions for the same Field with the OR operator. Also refrain from using VBA functions in a query when they are not absolutely necessary. This:
    Code:
    WHERE Left([ClassName], 11) = 'Intensive R'
    Can probably be replaced by:
    Code:
    WHERE [ClassName] Like 'Intensive R*'
    The exception being that you cannot use this technique if you have other possible data for the column beginning with "Intensive R" then something different from "eading" ("Intensive Rafting", "Intensive Ruling", etc.) that you do not want in the selection (and that your expression would return anyway).

    Combining both conditions, we have:
    Code:
    WHERE [ClassName] Like 'Intensive R*' OR [ClassName] Like 'Reading*'
    Attached Thumbnails Attached Thumbnails Query_OR.jpg  
    Last edited by Sinndho; 08-30-12 at 17:03.
    Have a nice day!

  3. #3
    Join Date
    Aug 2012
    Posts
    11
    Thank you very much Sinndho, it worked perfectly. I don't know how to appreciate your help enough.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •