I'm trying to make what into a geoprocessing tool that can be reused in ArcMap, but I'm receiving the following error. It looks like an issue with the way that I'm formatting the where_query variable, but I can't seem to get it right.
Traceback (most recent call last): File "C:\ArcPy\mean_center_drift.py", line 19, in arcpy.Select_analysis(in_feature, year_out_name, where_query) File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\analysis.py", line 84, in Select raise eExecuteError: ERROR 000358: Invalid expression 1Failed to execute (Select).and here is the code in its current form.
import osimport arcpyin_feature = arcpy.GetParameterAsText(0)out_features = arcpy.GetParameterAsText(1)origin_year = arcpy.GetParameterAsText(2)field_name = arcpy.GetParameterAsText(3)for x in range(10, 140, 10): year_range = int(origin_year) + x where_query = 'field_name'
Traceback (most recent call last): File "C:\ArcPy\mean_center_drift.py", line 19, in arcpy.Select_analysis(in_feature, year_out_name, where_query) File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\analysis.py", line 84, in Select raise eExecuteError: ERROR 000358: Invalid expression 1Failed to execute (Select).and here is the code in its current form.
import osimport arcpyin_feature = arcpy.GetParameterAsText(0)out_features = arcpy.GetParameterAsText(1)origin_year = arcpy.GetParameterAsText(2)field_name = arcpy.GetParameterAsText(3)for x in range(10, 140, 10): year_range = int(origin_year) + x where_query = 'field_name'