Hi,
I am using the Select by attribute tool to select the records. I have a date field name T: (A 1305) Site Walk-Finish so I need to select only those records which has the date (T: (A 1305) Site Walk-Finish) which are in last 7 days of today's date. I am not sure how to write the expression.
Thanks
Solved! Go to Solution.
I am sure there will be easier methods.
You can do the following steps.
1. Add a New Field in the attribute table with Date datatype.
Using Field Calculator (Python Parser), write the following expression for current date
datetime.datetime.now( )
2. In Select by Attribute, write the following expression
Date_Orig > Date_Now - 7
where Date_Orig is the original Date Field
Date_Now is the Current Date Field.
N.B.: I executed the above expressions in ArcMap, as I am not having ArcGIS Pro at the moment.
I am sure there will be easier methods.
You can do the following steps.
1. Add a New Field in the attribute table with Date datatype.
Using Field Calculator (Python Parser), write the following expression for current date
datetime.datetime.now( )
2. In Select by Attribute, write the following expression
Date_Orig > Date_Now - 7
where Date_Orig is the original Date Field
Date_Now is the Current Date Field.
N.B.: I executed the above expressions in ArcMap, as I am not having ArcGIS Pro at the moment.