Q:

Using numeric variable in where clause of ArcPy SearchCursor?

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?

A:

Your code fails because the variable name (pocidCnt) is inside a string and is therefore being taken literally: the final query being used is "pocid" = pocidCnt, where pocidCnt is clearly not a number that can be matched. You can substitute the value represented by the pocidCnt variable into the query string in the following ways:
cursor = arcpy.da.SearchCursor(fc1, ["pocid", "cl2total"], delimfield + " = " + str(pocidCnt))

or, preferably:
cursor = arcpy.da.SearchCursor(fc1, ["pocid", "cl2total"], "{0} = {1}".format(delimfield, pocidCnt))

