I am working on a simple application. The user can choose either Numeric values or string values to select (i.e. valName). However if you write the where clause like this:
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", FieldName + opName + "'" + valName + "'")
It doesn't work for numbers and if you write like this:
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION",FieldName + opName + valName)
It doesn't work for strings.
Any simple solution without if condition?