Re: Search keyword from string of data (Please help!)
- From: "rquintal@xxxxxxxxxxxx" <bob.quintal@xxxxxxxxx>
- Date: Thu, 18 Oct 2007 18:51:57 -0700
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.
.
- References:
- Search keyword from string of data (Please help!)
- From: kanley
- Re: Search keyword from string of data (Please help!)
- From: rquintal@xxxxxxxxxxxx
- Re: Search keyword from string of data (Please help!)
- From: kanley
- Search keyword from string of data (Please help!)
- Prev by Date: Re: Seeking Access experts to present to DAAUG
- Next by Date: Re: opps! typo error in previous post, loop through and return highest file
- Previous by thread: Re: Search keyword from string of data (Please help!)
- Next by thread: Access 2003 problem with wrong totals
- Index(es):
Relevant Pages
|