Select by Attribute in Table in ModelBuilder

5479
3
04-29-2010 08:40 AM
GabeJohanns
New Contributor
I am building a relatively simple model where I am cleaning up parcel ID numbers that came from another software database.

The data is in a table in an Access (.mdb) file. I have a Field with Parcel ID numbers that are 9 or 10 digits long. I am trying to find the correct tool from the Toolbox to select all the rows in the table that have 9 digits. I then need to take that selection and add a zero to the front of the numbers. This is a text field so leading zeros are acceptable.

If I were just doing these steps in ArcMap, I would open the table. Click the Options button and chose Select by Attributes. I then would build a simple expression: [PIN] LIKE "?????????". Then I would click on the Selected button to only show those selected rows and I would do a field calculation to add a zero to the front the of the PIN numbers.

I cannot find a tool that will replicate the Options | Select by Attribute when working with a table. All the tools that I have tried give me an error because the input cannot be a table.

This is so frustrating. Does anyone have a suggestion?
0 Kudos
3 Replies
ShitijMehta
Esri Regular Contributor
try making your input a layer first by using Make feature layer tool and then select layer by attribute.
0 Kudos
by Anonymous User
Not applicable

I realize it's been a while, but did you ever find a solution for this?  The "Make Feature Layer" option is not valid for a table input, so that won't work.

0 Kudos
by Anonymous User
Not applicable

Actually, just found the tool called "Make Table View", which allows the user to create a temporary table based on an SQL query.  Worked great in model builder!

0 Kudos