AnsweredAssumed Answered

SQL Statement Problems When Transferring My Code to Arc as a Script

Question asked by sb52191 on Jul 1, 2013
Latest reply on Jul 1, 2013 by rzufelt
I'm trying to make a tool for end users to use in Arc, and I want to make the SQL statement a variable. So far I have this:

Where_Clause= """"GRIDCODE"=6""" arcpy.SelectLayerByAttribute_management ("Quakesim_lyr", "NEW_SELECTION", Where_Clause)

which works fine in Python, but when I run it as a tool in arc, I'm getting Invalid Statement errors, even though the statement is the same.

Any advice? Bonus points if you can help me with the next step, which would be to replace the '6' with a variable that I could change.