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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String used for comparison

Status
Not open for further replies.

zeh

Technical User
Nov 5, 2004
2
US
Can't figure out how to filter my data using a query based on one field being the substring comparison for another.
My data is as follws:

LAST NAME TAX NAME
Powell Jamie Powell
Smith Countrywide Home Loans
Tomlinson Betty & Thomas Tomlinson

I would like my criteria to be if the data in LAST NAME is contained somewhere in the data in Tax Name, then go ahead and display it in the table. Is there an expression or funtion I can use?
 
WHERE InStr([Tax Name],[Last Name],1)>0

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks - I think this will work but when I try to do the calculation from the query window i keep getting a "undefined function 'where' in expression" error message. I'm running Access 2003 and it looks like this may be a bug? I found a article from Microsoft that says the fix is to:

start access
open database
alt f11 to open visual basic editor
tools>reference
click to clear the missin:,referencename.

This is where i get lost as there are so many choices

The first 6 choices are checked starting with VB for App down to Jet Expression?

Am I on the right track and if so any recommednations?
 
Anyway, you may try this:
WHERE [Tax Name] Like '*' & [Last Name] & '*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top