Re: Efficiency



The Like operator should work. If the back end is not an Access table, or if
you have set the option for ANSI 92, you might try using % as the wildcard
characters instead of *.

If you have lots of these criteria, and want to build an efficient search
based on only those boxes where the user actually enters something, see this
article and sample database:
Search Database: how to handle many optional criteria
at:
http://allenbrowne.com/ser-62.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Rob" <stimetsr@xxxxxxxxx> wrote in message
news:1151589061.925740.153760@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I wrote a script that built the SQL to examine text fields using a LIKE
operator,

text LIKE '*searchtext*'

but for some reason or other I couldn't get it to work. I instead
decided to test for inclusion by using

InStr(1, text, searchtext) > 0

which works, but the code runs a whole lot slower than I'd like it to.
The question is how much less efficient is evaluating the InStr
function and then doing a comparison versus simply using a LIKE
operator (i.e. would it be worth it for me to spend the time to make
the latter work)?


.



Relevant Pages

  • Re: Efficiency
    ... I create a SQL query in vb which counts the number of records ... If you have lots of these criteria, and want to build an efficient search ... article and sample database: ... how to handle many optional criteria ...
    (microsoft.public.access.queries)
  • Re: search via user input on form
    ... Search form - Handle many optional criteria ... Allen Browne - Microsoft MVP. ... Tips for Access users - http://allenbrowne.com/tips.html ...
    (microsoft.public.access.forms)
  • Re: How to code this math
    ... ' Inverse Cosine ... ArcCos = -PI ... That comes from a sample database MS released back in 1995, ... Tips for Access users - http://allenbrowne.com/tips.html ...
    (microsoft.public.access.formscoding)
  • Re: Using multiple fields to narrow records search?
    ... There is a small sample database in this link: ... boxes to narrow the search, and show the results in a continuous form. ... Tips for Access users - http://allenbrowne.com/tips.html ... I have an inventory database that contains the following hierarchy: ...
    (microsoft.public.access.formscoding)
  • Re: Advanced Form Search - Code tweak needed
    ... It's a sample database you download, and copy the module into your database. ... Perth, Western Australia ... Tips for Access users - http://allenbrowne.com/tips.html ... adding in to call the macro but it wouldnt work. ...
    (microsoft.public.access.forms)