Question

B

Bill

Hi ,

I am trying to find two fields are similar in a query. I try to see if both fields are matched.

I did it on the query but it doesn't work. Am I doing right thing ?

Similar: IIf([Field1] like [Field2],"Yes","No"

example :

Field1: R123V2
Field2: R123V
The result is "YES" because it s similar "R123V"

Field1: R123V2
Field2: GHIV21
The result is "NO"

Your help would be much appreciated.
Thanks
 
J

John Vinson

Hi ,

I am trying to find two fields are similar in a query. I try to see if both fields are matched.

I did it on the query but it doesn't work. Am I doing right thing ?

Similar: IIf([Field1] like [Field2],"Yes","No"

The LIKE operator accepts wildcards, such as * to match any string of
characters; if (as in this case) you don't use any wildcards, it acts
just like the = operator, and requires a perfect match.

Try

IIF([Field1] LIKE [Field2] & "*", "Yes", "No")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top