Select to view content in your preferred language

delete records older than 1 month

693
3
01-09-2023 07:53 AM
by Anonymous User
Not applicable

Is there a quick way to select all records that are older than 30 days? I'm hoping to use model builder to select all Completed records that are older than a month and delete them from my dataset. I prefer to use model builder so that I can set it and forget it! Any ideas would be appreciated.

0 Kudos
3 Replies
MichaelVolz
Esteemed Contributor

First off, do you have a Date field in your data that would allow a query to select all records where that date is at least 30 days from current date?

0 Kudos
by Anonymous User
Not applicable

No I do not have a field like that. I used an Arcade expression to calculate the Assignment due dates (a pothole is identified in the field and the date it needs to be filled by is based on the road classification) and was hoping that I would be able to use another Arcade Expression/SQL statement to select points with a Completed date that is at least 30 days from today's date.

0 Kudos
RobertAnderson3
MVP Regular Contributor

I was just coming looking to resolve the same problem, though I was hoping for a Python solution in ArcGIS Online Notebooks instead of ModelBuilder.

From Michael's question though, if you're using Workforce then when a user completes the assignment there is a field in the Assignments layer already that would capture the completed date and time "completeddate"! Then you could find a way to compare today's date to that date field.

Schema for Workforce can be found here: https://doc.arcgis.com/en/workforce/android-phone/help/workforce-schema.htm

0 Kudos