Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

SearchCursor where clause

$
0
0
I a script that selections by location, but after that i need it to search the selected in the "Year" field anything >= to 2009, then copy those features out. Any help would be very appreciated.

Her is what i currently have but i am getting an error of nameerror: name 'rows is not defined.

arcpy.SelectLayerByLocation_management(CCP, "WITHIN_A_DISTANCE", SP2, "1 MILE", "NEW_SELECTION")
if int(arcpy.GetCount_management("CURRENT_CUPS").getOutput(0)) > 0:
rows.arcpy.SearchCursor(CCP, "YEAR >=2009", "", "YEAR", "YEAR A")
for row in rows:
arcpy.CopyFeatures_management("CURRENT_CUPS", "CUPS")


Thanks.

Viewing all articles
Browse latest Browse all 2485

Trending Articles