I am stuck. Have Model Builder selecting features by attributes using text string which is a variable. I need to use LIKE operator (I use 'contains the text' from the drop-down list) but this gives me empty result:
LIKE '%\%rname\%%' ESCAPE '\'
rname is my variable name. I select a feature class form file geodatabase. No error but empty result.
When using the same tool 'manually' it selects what I expect, it gives empty output in model builder. It looks like is does not substitute %rname% with a variable value..
I have a similar situation and what appears to be incorrect result. My model iterates field values on feature class A. In the same model I have select by attributes on feature class B. I used the Calculate Value tool to create an additional variable, that simply adds a 9 to the front of the Value variable. My expression is
field LIKE %Value% AND field NOT LIKE %Remove% (I have to remove 5 digit values beginning with 9 from the selection from their similar 4 digit values without the leading 9). When I "manually" create this expression, it works. When I try to run with the iterator, it ignores the "remove" logic and selects more features than to be expected.