Re: Searching for best matches in string query

Tech-Archive recommends: Speed Up your PC by fixing your registry



You might want to take a look at this article describing the use of multiple
parameters. I've used this and it works well if searching on a number field,
but am still struggling if dealing with a text field. Nonetheless, it's an
interesting concept.
http://www.fabalou.com/Access/Queries/MultipleParameters.asp

Bob

John Spencer wrote:
One method would involve using a temp table that is populated with just
the words you are looking for. You would have to clear the records and
create new records each time you run the query.

TableFindWords with field TheWord
Bob
Jones
Roofing
Company

SELECT YourTable.Company, Count(YourTable.Company) as TimesFound
FROM YourTable INNER JOIN TableFindWords
ON YourTable.Company LIKE "*" & TableFindWords.TheWord & "*"
GROUP BY YourTable.Company
Order By Count(YourTable.Company), YourTable.Company

I'll have to ponder if there are other methods that you could use.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

I need to return a list of best/ranked matches from a field in a table. For
example, if the user searches for "Bob Jones Roofing Company", I'd like it to
[quoted text clipped - 8 lines]

Thanks.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200808/1

.



Relevant Pages

  • Re: Finding the value in a string
    ... "John Spencer" wrote: ... space before them and a comma after them. ... You are storing multiple values ... The query that I am ...
    (microsoft.public.access.queries)
  • Re: Parse space in Access field
    ... Thanks can you tell me how to use this code, I have to convert multiple ... I am a beginner to Access and so far only have ... John Spencer wrote: ... to remove the spaces and then put a 0 as the first character. ...
    (microsoft.public.access.modulesdaovba)