I'm trying to build a dynamic query that addresses user section of multiple values.
example: User input might be 1 or 1,2,3 or 1-5
I thought I could build a query such as
Getting an 'Invalid expression Failed' error
Am I barking up the wrong tree with my methodology?
Thanks
example: User input might be 1 or 1,2,3 or 1-5
I thought I could build a query such as
Code:
myfield = arcpy.AddFieldDelimiters(layer,"Number")
value = code to create an create an input list()
>>> value
[1, 2, 3, 4, 5, 6]
iQuery = '{0} in {1}'.format(value,myfield)
arcpy.SelectLayerByAttribute_management(layer,"NEW_SELECTION",iQuery)
Am I barking up the wrong tree with my methodology?
Thanks