Question

  • Thread starter Thread starter Bill
  • Start date Start date
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
 
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")
 
Back
Top