> Hi All,
>
[quoted text clipped - 11 lines]
>
> Marco
Marco,
Depending upon your database (MS Access, MSSQL, MySQL, Oracle, etc.)
would depend upon the specifics. However, what it sounds like is that
you want to do a query of a subquery such as SELECT * FROM (SELECT *
FROM Table WHERE Field LIKE `%MALE%`) WHERE Field LIKE ` BROWN ` LIMIT
10
The example syntax will NOT work for all of the database types but
should give you the idea of what to do. This looks for a word BROWN (as
delimited by spaces - for other begin/end delimiters you would need to
add in some OR's) within the query where the pattern of MALE (which
will also match FEMALE or MALE or MALE. or MALE; etc.) and limits the
result to 10 records.
Kerry
vonclausowitz@gmail.com - 29 Jul 2006 16:24 GMT
Hi,
I'm using an access database.
I don't want to limit the result to 10 records but I want to search for
words NEAR.
So word Y within 10 words of word X.
Marco
KwikOne schreef:
> > Hi All,
> >
[quoted text clipped - 26 lines]
>
> Kerry
Steve Gerrard - 29 Jul 2006 21:40 GMT
> Hi,
>
[quoted text clipped - 4 lines]
>
> Marco
Access doesn't have full text searching. Even in Oracle, you have to setup a
special text index and such in order to do proximity searches using CONTAINS and
NEAR.
I would at least make your initial query find records that contain both words,
regardless of separation, using something such as
WHERE (((Test.MemoField) Like "*BROWN*" And (Test.MemoField) Like
"*MALE*"));
If you are interested in word separation, not just number of characters, you
would then need to split the text of each record into words, then loop through
the words to see if the two are within 10 of each other.