I am having problems writing WhereClause for my program. I am using 10.3 arcmap. My layer comes form a file geodatabase.
I have this code:
mlayer = arcpy.mapping.ListLayers(mxd, "1415_LGA_SpatJ", df)[0]
fn_field = 'MAPID'
....function which creates list of values a_list
for each_a in a_list:
whereClause = '"%s" = %s'%(fn_field, each_a)
arcpy.SelectLayerByAttribute_management(mlayer, "NEW_SELECTION", whereClause)
....
This code works when values of my field are numbers (field is long integral)
Now I need to modify the code and use another field instead, which has strings. I get an error, invalid sql expression.
Could someone please help with updating sql statement.
I tried few things, but don't understand it really well.