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!

selecting recs where field1 text is contained in field2

Status
Not open for further replies.

MontyBurns

Programmer
Oct 3, 2001
99
GB
Hi,

I need to return only those records where the contents of field1 is contained in field2. Eg.

Field1 1234
Field2 \\svr\share\folder\1234.pdf

It'll be something like:

SELECT *
FROM tblMyTable
WHERE Field2 Like *Field1*

But this doesn't work. Any ideas anyone?

Thanks,
Burns
 
Monty,

The criteria row for Field2 should contain

((InStr(1,[Field2],[Field1])<>0));

When you run the query and then go back to the design view, Access will have converted this criteria to another field that has just InStr(1,[Field2],[Field1]) in the Field row and <>&quot;0&quot; in the criteria row.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top