I always seem to get hung up on these simple strings.
Here again I don’t quite get the syntax for use in SelectLayerByAttribute_management
If I use the following with a field named “Name” the query works just fine
However when I try to use a variable I can never seem to get the syntax right
Thanks
Here again I don’t quite get the syntax for use in SelectLayerByAttribute_management
If I use the following with a field named “Name” the query works just fine
Code:
iQuery = ' "Name" = \'Joe Blogs\' '
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", iQuery)
Code:
iPerson = “Joe Blogs”
iQuery = '"Name" = "' + aCenterMapOn + '"'
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", iQuery)