Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

as the title already suggests... 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 and that does not really help.

Cheers, Tom

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.