Select to view content in your preferred language

Problem with Select Layer by Attribute in ModelBuilder

1790
2
09-13-2012 11:57 PM
PesztorKasztakoro
New Contributor
I have the following problem in ArcInfo version 9.3.1. I want to use Select Layer by Attribute tool in ModelBuilder. I have an expression like:

"field" LIKE '% value%'

which does not work, there is no selected features in map window and table. But, exactly the same syntax works by Selection / Select by Attributes ... and the table shows selected records.


Any suggestions?
Tags (2)
0 Kudos
2 Replies
NiekGoorman1
Regular Contributor
I think this is an issue with the type of data you're trying to select. It's impossible to tell without seeing your model, but does it first store the data in a personal geodatabase? If so, you should now use a different syntax for the selection. Try:

[field] LIKE '*value*'

See also the select by attributes help.

Also make sure there isn't something earlier in the model that deletes or alters the features you're trying to select. And double-check that your query is not set to "remove from current selection". I've made this mistake more often than I'm willing to admit...
0 Kudos
FredIrani
Deactivated User
If it is any consolation, I have the same problem.  Extract by Attribute worked fine in ArcMap 10.0 but no longer works under 10.1 when comparing other than the first two fields in an input attribute table in your sql expression.

Other new V 10.1 problems I've found:

It the output from GetCount is Zero, the result often cannot be assessed because statistics are no-longer calculated for an empty output dataset.

If the output of Calculate Value is Zero, it cannot be assessed because V10.1 MB now confuses a valid output value of Zero to be the same as FALSE.  If you want to iterate based on more than one value, you will be stopped from entering Calculate Value to evaluate your expression if one of the values you wish to evaluate has gone to Zero and you have set this value as a precondition for Calculate Value.

Version 10.0 used to avoid this by creating (what I call) an implied dependency if your Calculate Value expression included an in-line substitution (%Variable%), but this has gone away in 10.1.  Now, if any of your in-line substitutions go to Zero and your expression is dependent on that value via precondition, you can't evaluate it because the precondtion goes to False.  You often can't remove the precondition, however, because it is your only means of controling the logical flow of the model.

This has left me stranded for the time being in converting my 10.0 model to 10.1.
0 Kudos