Hello
I am trying to create a scriptool to select the survey data after a certain start date
If Annual_Growth is 10 I want it to add 20 days to the Initial_Date to give the start date
If Annual_Growth is 20 I want it to add 50 days to the Initial_Date to give the start date
Survey_Data = arcpy.GetParameterAsText(0)
Annual_Growth = arcpy.GetParameterAsText(1)
Initial_Date = arcpy.GetParameterAsText(2) #Date input (date format is dd/mm/yyyy)
T_date = datetime.datetime(Inital_Date)
start_date = T_date + datetime.timedelta(days = num_days)
if Annual_Growth ==10: num_days = 20
elif Annual_Growth == 20: num_days = 50
Where_Clause = "DateTimeUTC >= '{}'".format(start_date)
arcpy.management.SelectLayerByAttribute(Survey_Data, "NEW_SELECTION", Where_Clause)
The first issue I run into is that the initial date input is perhaps in the wrong format for timedelta to add the days ?? Any help would be appreciated. Thank you