Trying to create a simple select by attribute script that will select based upon an input in a tool, in ARC Toolbox. My data is stored in a File database in a Feature Dataset called "Control", Feature Class is called "Monuments". Field is called "Township".
Here's the code
# Select Features base on Township
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
Monuments = arcpy.mapping.ListLayers(mxd, "Monuments") [0]
TWN = arcpy.GetParameterAsText(0)
arcpy.SelectLayerByAttribute_management(Monuments, "NEW_SELECTION", "Monuments.Township" = TWN)
But getting Error message. "Keyword can't be an expression."
Any thoughts... Thanks in advance.
"Monuments.Township" = TWN
to do as a parameter?arcpy
. I'm just telling you that, from a basic Python syntax perspective, what you're writing now cannot work.