Results 1 to 6 of 6
  1. #1
    eschmidt12 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    8

    Like "*" Criteria - is this necessary?


    I'm working on improving the performance of an existing query. A criteria for one of the fields is Like "*". Is this necessary to include? Is there a difference between this and not having any criteria at all?

    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    The wildcard will allow return of all records if the parameter is not provided.

    See if this helps explain use of LIKE operator and wildcard http://datapigtechnologies.com/flash...earchform.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    eschmidt12 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    8
    That makes sense - but if I'm not sorting by that particular field at all (i.e. I ALWAYS want every record returned), is that field useful, or is it just an extra calculation that the query has to perform?

    I guess the question is - if I don't include Like "*", will I leave out some records?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Do you mean the criteria is just: Like "*", not: Like [input criteria here] & "*" ?

    If the former then remove it, it accomplishes nothing.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    eschmidt12 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    8
    Quote Originally Posted by June7 View Post
    Do you mean the criteria is just: Like "*", not: Like [input criteria here] & "*" ?

    If the former then remove it, it accomplishes nothing.
    Exactly...it's just Like "*"...I wanted to confirm before I broke the query. Thanks!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    You could always put it back. But removing should not be an issue. It doesn't hurt being there, just doesn't do anything except maybe add a tiny bit of overhead to the query execution.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  2. Replies: 4
    Last Post: 03-23-2012, 01:18 PM
  3. Passing criteria "NULL" or "IS NOT NULL" to a query
    By SgtSaunders69 in forum Forms
    Replies: 1
    Last Post: 12-24-2011, 02:22 AM
  4. Replies: 2
    Last Post: 05-17-2011, 02:40 PM

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