[GIS] Select for a specific number of characters

arcgis-desktopselect-by-attribute

I am using ArcGIS 10.3.1 and have an attribute that has either 4 or 5 characters; i.e., CO-1, BY-3, CAR-1, MRT-8.

All letters are uppercase, this is in a personal GDB, and this is a string field.

I am trying to select for only the attributes that have 4 characters.

Best Answer

As your data is in a personal geodatabase you can simply use:

len([myField]) = 4

This will select all rows where the string in the field "myField" is 4 characters long.

Related Question