General discussion

Locked

Finding the Contents of One Field in Ano

By ldsteven ·
I have been trying to find a way to compare a text field FieldAA in Table A to see if the data in text field FieldBB in Table B contains the string in FieldAA.

I am searching FieldBB for the value of each occurence of FieldAA. This value will change from record to record and I already know that the data in the two fields will seldom, if ever, be identical so the usual FieldAA = FieldBB statement will result in failure.

I have been trying to use the "Like" statement with the "*"wildcard,but have not been able to figure out a way to make either one work in a statement that includes a fieldname rather than a literal value.

Any ideas on if and how this can be done would be most appreciated.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Finding the Contents of One Field in Ano

by shadowtraitor In reply to Finding the Contents of O ...

If you use the select statement and
SELECT * FROM PARTS WHERE FieldAAvalue LIKE '%FieldBBvalue%';

the wild card value is the '%' sign aND YOU USE THE Field names as paramaters that will take the place of Location and Back in the Statement.
that should help you.

Collapse -

Finding the Contents of One Field in Ano

by ldsteven In reply to Finding the Contents of O ...

Poster rated this answer

Collapse -

Finding the Contents of One Field in Ano

by fofa In reply to Finding the Contents of O ...

Like is designed to work with a string/literal, that was just the design. You can use a filed, but you can't use wildcards along with it. And the access wildcard is * not % like other SQL engines. You most likely will have to breakup the table and use multi-queris or what I usually do is write some VBA to do it. I woulod write a VBA to create a SQL statement that would process each one, then put the results in a new table with unique keys pointing back to the other tables. Than you can use a regular query to view the results.

Collapse -

Finding the Contents of One Field in Ano

by ldsteven In reply to Finding the Contents of O ...

Poster rated this answer

Collapse -

Finding the Contents of One Field in Ano

by fred_e944 In reply to Finding the Contents of O ...

Check out the behaviour of the InStr operator in Access VBA. It may be of some help.

Collapse -

Finding the Contents of One Field in Ano

by ldsteven In reply to Finding the Contents of O ...

Poster rated this answer

Collapse -

Finding the Contents of One Field in Ano

by ldsteven In reply to Finding the Contents of O ...

This question was closed by the author

Back to Windows Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums