Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQheLp please using 2 tables & 'like' in another field

Status
Not open for further replies.

knowone

Technical User
Sep 13, 2002
2
US
If any help can be offered in this I would really appreciate it.

Here is the situation;
Web logs held in text files which are linked to as tables. Another table holds "product codes" as one of the fields. I want to use the product field in the 2nd table as an identifier for the log table. The trick is, the product code appears as part of teh target url string. I have been able to enter the desired string one at at time using the like statement and no problem. but I want the kile criteria to be pulled from the product table.

Here is what I've been playing with so far, however I'm not a programer.

-Many Thanks

SQL CODE:
Code:
SELECT [resultspage_01].[date], [resultspage_01].[target], [TABLE REF: Publications].[product]
FROM [resultspage_01], [TABLE REF: Publications]
WHERE [resultspage_01].[target] like [TABLE REF: Publications].[PUB-family]
GIVES ME A RESULT OF:

-nothing- just an empty view.

PS running MS Access 2000 on MS Win2000


- - - KnowOne [infinity] Says Thank You - - -
 
Let me see if I understand your situation.

You have a text file with fields that you can refer to in a query. For example,[resultspage_01].[target], means the field named target in the text file named resultspage_01.
And you have a database table named Publications with a column named PUB_family.

The target values are URLs with querystrings like

and you want to match that to the value "new orleans" from PUB-family?



The comparison operator LIKE is usually used to match a pattern created with wildcard characters. In Access ? matches any single character and * matches any number of characters. So you would write

Code:
LIKE "*new?orleans"

See Access help Using Wildcard Characters in String Comparisons and Like Operator.

This idea is combined with another technique, building string expressions. Here you must build a string expression that combines the wildcard pattern and the column name which has the product codes. Ignoring for the moment the problem of the blank space in "new orleans", (with any luck your product codes won't have spaces) here is the expression.

Code:
LIKE "*"&[TABLE REF: Publications].[PUB-family]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top