Re: Search keyword from string of data (Please help!)



On Oct 18, 7:38 pm, kan...@xxxxxxxxxxxxxx wrote:
On Oct 18, 4:01 pm, "rquin...@xxxxxxxxxxxx" <bob.quin...@xxxxxxxxx>
wrote:



On Oct 18, 5:51 pm, kan...@xxxxxxxxxxxxxx wrote:

I have a main table with a text description field. In this field, its
populated with a string of data. I need to identify from this string
of data the name of the vendor using some keywords.

I have another table that contains 2 fields, one being the keywords to
search for from the string of data and the other field being the
vendor name to pair up with the record.

How do I reference the keywords from the 2nd table and search thru the
string of data from the text description field from the main table and
then apply the vendor name to the main table?

Please help.

You can create a query containing both tables. Set the criteria for
the [main table].[text description] to LIKE "*" & [another table].
[keyword] & "*"

Note that you really should have each keyword on a separate row of the
table, to select with an or condition. Two keywords in the same row
means that the query will only match if the exact phrase is found,
with the same sequence. You van insert an asterisk to allow variations
in spacing, punctuation and intermediary words.

Keyword finds
John Mary John Mary
John*Mary John, Mary
John*Mary John Smith or Mary Christmas

--
Bob Quintal

I guess I was not clear enough, let me give an example.

So below are the two tables I have. In Table 1, I have a text
description field. I need to search from the text description field
to determine who the vendor is. Therefore, in table 2, I have a list
of keyword that I can identify the vendor with by searching through
the text field in table 1.

How do I identify the vendor using table 2 and then populate table 1
with the vendor name reference in table 2?

Table 1

Text Description Transaction amount Vendor
2323a2007 ABC Bank $10
ABCVISA Bank $20
DataABC $30
Sep 07 ABC Bank $20
CDE Bank $30
Aug 07 ABC Bank $50
Bank of EFG $20
EFG transaction adj $10

Table 2

Keyword Vendor
ABC ABC Bank
CDE CDE Bank
EFG Bank of EFG

You were clear enough, except that you said "one being the keywords to
search for from the string of data and the other field being the
vendor name" Had you not pluralized "keywords" I would have not added
the cautionary note about one keyword per row, since that is what you
have.

You build a query as I detailed above. put the two tables into the
query. In the grid section, bring down the vendor from table 2. bring
down the Text Description from table 1 In the criteria row, under the
text description column, put LIKE "*" & [keyword] & "*"

Run the query. When you test it works in a view, convert the query to
an update query to set the table 1 vendor with the table 2 vendor.



.



Relevant Pages

  • Re: Contains clause with only NOT keywords
    ... For your date query it would look like this ... You cannot search on a date string and hope for it to be interpreted as ... I am designing a search screen that searches for keywords in Text ... I also tried separating out the NOT keywords into a series of " and not ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Contains clause with only NOT keywords
    ... For your date query it would look like this ... as sql FTS can only interpret the date string as a string and only do not ... I am designing a search screen that searches for keywords in Text fields ... I also tried separating out the NOT keywords into a series of " and not ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Contains clause with only NOT keywords
    ... You have to parse your query so that it looks like this: ... as sql FTS can only interpret the date string as a string and only do not ... Date-Range search in conjunction with keywords NOT found in the free text. ... a standard keyword search might create this Contains clause: ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Contains clause with only NOT keywords
    ... The crux of the matter was whether I could use JUST exclusions in the ... For your date query it would look like this ... as sql FTS can only interpret the date string as a string and only do not ... I am designing a search screen that searches for keywords in Text fields ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Keyword(s) query.
    ... Create a search form with a place to put all the keywords. ... Dim LettAs String ... Behind the search button on the form i open the following query (You can ... Hope this dirty way of doing it helps. ...
    (comp.databases.ms-access)