Exact results using wildcards

K

khenry100

I'm using query builder to look for all records in a column that contain the
word "free"
I'm using *free* in the criteria line which returns records containing
"free" but also "freedom". "freely" etc.
I tried "*free *" (a space after free) that doesn't work since it doesn't
return any records that end with the word free.
Any help with just finding the word and not words containing the word would
be much appreciated.
thanks
 
E

Ed Warren

Like * free * (* space free space *) will return any records with the 'word'
free in the field
Like *free * (*free space *) will return any records with the word free and
all that end with free.
Like *Free* will return any record containing the character string free.

Ed Warren
 
J

John Vinson

Any help with just finding the word and not words containing the word would
be much appreciated.

ummm...

"Free"

on the criteria line.

If you don't want wildcard functionality, don't use wildcards!

Am I missing something?

John W. Vinson[MVP]
 
J

John Nurick

Using the LIKE operator you need to do it three times, for beginning,
middle and end of the field, taking into account all the characters
other than spaces that might adjoin the word, e.g. (air code)

LIKE "*[ ""'({[]free[] .,;:?!""')}]*"
OR LIKE "free *"
OR LIKE "*[ ""'({[]free"

Or use the rgxValidate function at
http://www.mvps.org/access/modules/mdl0063.htm, with a pattern of

\bfree\b

to match <word boundary> f r e e <word boundary>
 
K

khenry100

3 times worked! thanks

John Nurick said:
Using the LIKE operator you need to do it three times, for beginning,
middle and end of the field, taking into account all the characters
other than spaces that might adjoin the word, e.g. (air code)

LIKE "*[ ""'({[]free[] .,;:?!""')}]*"
OR LIKE "free *"
OR LIKE "*[ ""'({[]free"

Or use the rgxValidate function at
http://www.mvps.org/access/modules/mdl0063.htm, with a pattern of

\bfree\b

to match <word boundary> f r e e <word boundary>

I'm using query builder to look for all records in a column that contain the
word "free"
I'm using *free* in the criteria line which returns records containing
"free" but also "freedom". "freely" etc.
I tried "*free *" (a space after free) that doesn't work since it doesn't
return any records that end with the word free.
Any help with just finding the word and not words containing the word would
be much appreciated.
thanks
 
Top