AnsweredAssumed Answered

Make feature layer based off last edited date

Question asked by trace.stanford9 on Jun 24, 2019
Latest reply on Jun 24, 2019 by brianmcleer

I have editor tracking enabled on a feature class, and need to calculate some fields within a polygon that are edited each day. I currently have a script that will calculate the fields for all of the features within the polygon, but there are thousands of features and I only need to calculate the ones that were edited each day. My issue is creating a feature layer with a where clause for only today's features. What's strange is that it will work using the python window within ArcMap, but won't work as a standalone script. The layer created just contains all of the features...


arcpy.MakeFeatureLayer_management(meters, 'meter_layer', "'last_edited_date' >= 'DATEADD(d, 0, DATEDIFF(d, 0, GETDATE()))'", "", "")


Any help would be greatly appreciated