Select to view content in your preferred language

where clause of my selectlayerbyattribute_management keeps returning error

1984
4
03-26-2013 07:43 AM
KP
by
Deactivated User
Refering to ArcGIS 10 Help, I have tried writting my where clause exactly as stated in the help (using quotes, brakets, etc) and I keep getting Error 000358: Invalid expression Failed to execute (SelectLayerByAttribute).  I am running this inside arcmap.

arcpy.SelectLayerByAttribute_management("zipcode_27012", "NEW_SELECTION", "NAME" = '27012')


There must be something obvious I am missing.
Tags (2)
0 Kudos
4 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Kevin,

What type of data are your working with (i.e. shapefile, File Geodatabase feature class, Personal Geodatabase feature class)?

Try the following:

arcpy.SelectLayerByAttribute_management("zipcode_27012", "NEW_SELECTION", "NAME = '27012'")
0 Kudos
KP
by
Deactivated User
Simply a shapefile.
0 Kudos
JakeSkinner
Esri Esteemed Contributor
The syntax I posted initially should work.
0 Kudos
KP
by
Deactivated User
I ended having to use three(""") to get it to work.
0 Kudos