Using String Functions (LEFT, RIGHT, MID) in Select By Attributes against a File Geodatabase using ArcMap 10

Your queries should follow the SQL format discussed here. For what you're looking for, you can use something like this:

"Some_Field" LIKE 'A%'

The % is a wild card, so this would return records that have values in "Some_Field" that start with 'A'.


You can use Substring("fieldname", start, length) to mimick, left(), right() and mid() functions when querying a fgdb.

Left and Mid are obvious.

To extract the right 2 characters would be Substring("fieldname", char_length("fieldname") - 1), 2).

Column numbers are 1-based.


Try this code:

left("Some_Field",1) = 'A'

where the comparison operator is outside the parentheses, and the string value is in single quotes.

Note that string searches are case sensitive in a file geodb. So you might also have to use the UPPER or LOWER functions, or search for 'A' or 'a'.