10

I want to query the length of a string column and thought to use:

LEN([ColumnName]) > 5

However, that doesn't work at all. I'm querying a table in a fGDB in ArcMap 10.1, hence the notation of [ColumnName].

Can someone help me?

The error message I'm getting from ArcGIS is that I'm using an invalid SQL statement.

asked Sep 9, 2013 at 12:49

2 Answers 2

19

To calculate the length in characters of a string expression use CHAR_LENGTH(string_exp)

Field name delimiters for file geodatabase is double quotes (not square brackets).

So this should work:

CHAR_LENGTH("ColumnName") > 5

Here is a SQL reference for query expressions used in ArcGIS.

answered Sep 9, 2013 at 13:20
0
1

What if you add a new field to your table called, for example, "str_length" and then populate the field with the length of the value of the field you want?

str_length = len(columnname)

Then do your selection on the new calculated field.

answered Sep 9, 2013 at 13:21

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.