I have a field "HNR_S".

It contains values like "124", "122", "1315", "1465", "15151", "124512642".

How can I select more than three numbers?

  • You mean values with length greater than 3? and what is the type of column, string or numeric? – Shahzad Bacha Mar 12 at 5:59
  • yes, exactly sir and that contains mixed characters like string, special characters and numeric. – Rakesh Reddy Posham Mar 12 at 6:00
  • type for a column can be either string or integer, can you confirm in the properties of your layer? – Shahzad Bacha Mar 12 at 6:02
  • It have string. – Rakesh Reddy Posham Mar 12 at 6:03

To select records with length greater than a specific value, you can use CHAR_LENGTH(string_exp) expression in "Select by Attribute" ArcMap.

So in your case it should work like this should:

  • 1
    @RakeshReddyPosham Please accept the answer if it solved your problem. – ahmadhanb Mar 12 at 6:23
  • sir, i need one more help it is not working in other shape_file could you please suggest why it is not working, i checked that shape file it also like my old shape file only but i'm not understanding. – Rakesh Reddy Posham Mar 12 at 6:24
  • can you check the column type in other shapefile? it should be of type string otherwise it won't work – Shahzad Bacha Mar 12 at 6:36
  • Possibly because your other shape file has a numeric field, you could also try CAST(HNR_S AS INTEGER) > 100, I've never used this function but it should return 0 if there's invalid characters but would probably return SQL ERROR Invalid..., alternately you could try CHAR_LENGTH(STR(HNR_S)) > 3 to ensure that your numbers are tested as strings. – Michael Stimson Mar 12 at 6:38
  • i checked that other shape file also in string type only but it is not working.i'm getting error i.e "Function or procedure does not exist" – Rakesh Reddy Posham Mar 12 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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