I know this question has been answered but I am not seeing an adaptation that I can understand. I am trying to use a numeric variable in a where clause and just having a hard time figuring it out.
fc1 = "L:\ENGINEERING\collind\ArcGIS\Default.gdb\sedaSampleHistory"
fieldname = "pocid"
delimfield = arcpy.AddFieldDelimiters(fc1, fieldname)
pocidCnt = 3
cursor = arcpy.da.SearchCursor(fc1, ["pocid", "cl2total"], delimfield + " = pocidCnt ")
I have tried all kinds of ways to get pocidCnt to work in the where clause and I am not having any luck. If I write it as
cursor = arcpy.da.SearchCursor(fc1, ["pocid", "cl2total"], delimfield + " = 3 ")
it works fine.
What am I doing wrong?