AnsweredAssumed Answered

Little SQL query help please

Question asked by jpedder on Dec 19, 2012
Latest reply on Dec 20, 2012 by jpedder
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

iQuery = ' "Name" = \'Joe Blogs\' ' arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", iQuery)


However when I try to use a variable I can never seem to get the syntax right

iPerson = ???Joe Blogs??? iQuery = '"Name" = "' + aCenterMapOn + '"' arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", iQuery)


Thanks

Outcomes