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

MSAccess Query

Status
Not open for further replies.

camster39

Technical User
Jul 22, 2003
49
US
Have a field called "Store Name". Want to create a simple If-then statement that if the value of store name contains "Mike's" then display a "Y" otherwise display an "N".

I tried doing something like:

Answer: IIf([STORE].[NAME]="Mike's","Y","N")

Then I realized that the store name contains the word "Mike's" but that isn't the entire value (i.e. Mike's Furniture, Mike's Hardware, Mike's House).

So I guess I'm looking for an IIf but instead of returning a "condition true" for an exact match I would want to return a "condition true" for a partial match.

Using Access 97.

Thank you.
 
Hi,
Code:
 IIf([STORE].[NAME] Like "*Mike's*","Y","N")


Skip,

[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top