Re: Efficiency
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Thu, 29 Jun 2006 22:14:12 +0800
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)?
.
- Follow-Ups:
- Re: Efficiency
- From: Rob
- Re: Efficiency
- References:
- Efficiency
- From: Rob
- Efficiency
- Prev by Date: Efficiency
- Next by Date: Re: General question on writing a complex query
- Previous by thread: Efficiency
- Next by thread: Re: Efficiency
- Index(es):
Relevant Pages
|
|