This question already has an answer here:
I want to use input string in part of the SQL query, and the code has been posted below.
import arcpy import os in_features = arcpy.GetParameterAsText(0) target_county = arcpy.GetParameterAsText(1) out_path = os.path.dirname(in_features) out_name= "%s.shp" % target_county where_clause=""""CNTY_NM" = %s""" % target_county arcpy.FeatureClassToFeatureClass_conversion(in_features, out_path, out_name, where_clause)
I don't know what is wrong with the code. Any suggestions?
I am using ArcGIS 10.3.1 Desktop Advanced License.