I have a feature class of suburbs that I want to do a select by attribute on the Locality (=suburb names) field, passing a user input string parameter to selection expression.

I have the query working when the string parameter is the full Locality name - the working query is UPPER("LOCALITY") = UPPER('%String%'). The Locality string values are title case.

I want the user to be able to pass a string that is only part of the full locality string, as the parameter for the expression. In the data I have localities Mount Jeff, Jeffs Point, Jefferson - I want the user to be able to input "Jeff" as the parameter text string and select these three occurences.

I think my confusion is with how to add the wildcard to the UPPER('%String%') to indicate that the parameter string may only be part of the text field value. My previous use of wildcards has been using the % character but cannot get my head around this expression where the % character is also used to identify the parameter.

Currently at home working off a shapefile copy of the data, (finished model will be pointing to an SDE/enterprise feature class).

  • Have a look at the help file, it's all there, you are wanting to build an expression using the LIKE operator. – Hornbydd Mar 16 at 15:56
  • 1
    An equivalence operator is the wrong logical test -- instead use LIKE. Shapefile and enterprise databases have very different SQL comparison tools, so the former is not a good prototype environment for the latter. – Vince Mar 16 at 15:58

Your Answer

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

Browse other questions tagged or ask your own question.