Results 1 to 5 of 5
  1. #1
    RandyH is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2020
    Posts
    25

    Like vs Not Like in Criteria

    When searching a Table [Style].[Type] for specific Records out of 58,000 Records which is more efficient,
    "Like (Or) - Not Like <> (And)"?

    Or is this efficiency based solely on the number of parameters in Criteria?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Please give a sample of your proposed statement using your data.

  3. #3
    RandyH is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2020
    Posts
    25
    In Query Design
    [Style].[Type]
    Criteria = "JKit" Or "LGD" Or "NDL" Or "Sales"

    Or

    <> "GemPack" And <> "Plating" And <> "TU" And <> "Engraving" And <> "NJI"

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    You are using = and <>

    Here are some ways of accomplishing
    [Style].[Type]
    Criteria = "JKit" Or "LGD" Or "NDL" Or "Sales"


    1)
    Criteria = "JKit" Or
    Criteria = "LGD" Or
    Criteria = "NDL" Or
    Criteria = "Sales"

    2)
    Criteria IN( "JKit" , "LGD", "NDL", "Sales")

    For <> "GemPack" And <> "Plating" And <> "TU" And <> "Engraving" And <> "NJI"

    I would try (untested) -- you should google de Morgans Law

    Criteria Not IN ("GemPack" , "Plating" , "TU" , "Engraving" , "NJI" )

  5. #5
    RandyH is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Dec 2020
    Posts
    25
    Either way they both work. My question was " is one more efficient than the other?"
    Thanks Randy!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 08-15-2016, 05:56 AM
  2. Replies: 2
    Last Post: 04-02-2015, 12:45 PM
  3. Replies: 1
    Last Post: 11-13-2014, 11:34 PM
  4. Replies: 4
    Last Post: 08-30-2014, 10:23 AM
  5. Replies: 5
    Last Post: 08-02-2012, 09:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums