I'm working on a script that involves an arcpy.select_analysis function. The problem I have is that when I run the script it produces an empty file. I've verified that the whole thing works when in the Select GUI, and produces the correct output, and then have even exported the SQL expression and copy/pasted it into the arcgis python window, but no dice.
]
I've zoomed the extent both way out and way in to see if that makes a difference, but it doesn't. Any advice would be much appreciated!
Answer
Instead of:
"'ZIP' = '10004'"
try this:
'"ZIP" = ' + "'10004'"
The reason that your original expression gives an empty output is because the string 'ZIP' is not the same as (equal to) the string '10004'.
No comments:
Post a Comment