String query

  • Thread starter Thread starter Bernadette Houghton
  • Start date Start date
B

Bernadette Houghton

I'm trying to compare two fields in a table. If the whole of the first field
is found somewhere within the second field, I need to output the second
field into a third field..

e.g.

Field1 = abcd

Field2 = xyzabcdefg

Since Field1 is found within Field2, Field3 =xyzabcdefg

I 'm able to do this if the wholecontents of Field1 exactly matches the
whole contents of Field2, viz - Field3: IIF([Field1] = [Field2],[Field2],"")

However, I can't get this expression to recognise when Field1 matches only
part of Field2.

Regards

Bernadette
 
Bernadette,
Answered elsewhere.
Please do not multi-post. if you feel you must post the same question to
more than one newsgroup (and it's seldom necessary), cross-post by adding
each additional newsgroup in the To Newsgroups: box, separated by a comma.
This way an answer in one newsgroup will be seen in each of the others. More
readers will see the response and learn, and less time will be spent on
duplicate answers.

See Netiquette at http://www.mvps.org/access

It's a great site to visit anyway.
 
Back
Top