Select to view content in your preferred language

Help with selecting similar names from two columns

763
6
02-20-2023 09:22 AM
Labels (1)
Aique
by
Emerging Contributor

Hello

I have two columns with the names OWNER_NAME1 and BIZ_NAME.

The data is messy, so the business name and owner name may not be the same - but might be similar. 

I want to select the records where the names in the two columns are similar. 

I tried this but it says the expression is invalid. 

 BIZ_NAME = BIZ_NAME LIKE CONCAT(%OWNER_NAME1%) OR OWNER_NAME1 LIKE CONCAT(%BIZ_NAME%);

Please advise, 

Thank you, 

A

0 Kudos
6 Replies
DavidPike
MVP Notable Contributor

What's CONCAT meant to be doing?  Get rid of it.

Aique
by
Emerging Contributor

BIZ_NAME = BIZ_NAME LIKE (%OWNER_NAME1%) OR OWNER_NAME1 LIKE (%BIZ_NAME%);

Start Time: Monday, February 20, 2023 11:45:23 AM
ERROR 000358: Invalid expression
Failed to execute (SelectLayerByAttribute).
Failed at Monday, February 20, 2023 11:45:23 AM (Elapsed Time: 0.04 seconds)
0 Kudos
Aique
by
Emerging Contributor

Still returned an error without Concat 

0 Kudos
DavidPike
MVP Notable Contributor

Apologies I didn't understand quite the complication of this (long day).

perhaps:

 

BIZ_NAME LIKE('%' || OWNER_NAME || '%')  OR  OWNER_NAME LIKE('%' || BIZ_NAME || '%')  

NB I can't remember if LIKE is case sensitive in feature classes

 

0 Kudos
Aique
by
Emerging Contributor

Biz name might be Sporty and Owner name might be Sporty Associates LLC 

0 Kudos
DavidPike
MVP Notable Contributor

where are you using this expression? what tool etc as it is important

0 Kudos