Hi all,
I am trying to 1) Select by Attribute and 2) overwrite a feature class with selected features. Below is the script that I'm trying as a start.. and am getting an error related to Select by Attribute. Ultimately, need to select last 365 days of data (not Baker neighborhood) and overwrite a feature class.. on a daily basis. Thank you in advance for any assistance! Shelby
# Description: Extract features to a new feature class based on an attribute query
# Import system modules
import arcpy
# Make a layer from the feature class
arcpy.MakeFeatureLayer_management ("D:/pd/crimeD.gdb/dencrime", "crimelayer")
# Select all crimes that happened in Baker
arcpy.SelectLayerByAttribute_management ("crimelayer", "NEW_SELECTION", ' "NEIGHBORHOOD_ID" = baker ')
# Write the selected features to a new featureclass
arcpy.CopyFeatures_management("crimelayer", "Bakercrime")