I'm trying to apply the sql expression described here https://geonet.esri.com/thread/76028, that involves querying out odd values in a field. The specific sql expression is Round(NumberField / 2, 0) <> NumberField / 2
.
I've written this in python:
import arcpy
plantFile = r"U:\Users\K\Plants.shp"
field = "UID"
expression = Round("UID" / 2, 0) <> "UID" / 2
arcpy.SelectLayerByAttribute_management(plantFile, "NEW_SELECTION", expression)
and it returns this error: NameError: name 'Round' is not defined
The expression works when applied in ArcGIS, but not in arcpy. Any hints?
No comments:
Post a Comment