Hi Guys,
I was trying to use python for select by attribute using variables from user input. It works fine just for a single variable, but when it comes to more than one variable using the "AND" its giving me error.
here part of the code :
MER = sys.argv[1]
TWP = sys.argv[2]
RNG = sys.argv[3]
SEC = sys.argv[4]
Expression ="MER= "+MER "AND" "TWP= "+TWP "AND" "RNG= "+RNG "AND" "SEC= "+SEC
# Process: Select Layer By Attribute
arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", Expression)
Any idea please ???
Thanks,
Dan