I'm working on a project where the data gets updated every Monday (an XLSX file which I bring into a File Geodatabase and work with from there). I've been tasked with automating the data massaging. One of our fields contain dates and users are interested in features dated 3 weeks before today's date and 3 weeks after today's date.

Working manually I would just sort the table and select features that match the time criteria then code them accordingly (there is a second field for the coding) but how do I achieve this in ModelBuilder?

I know how to export a selection, but I have no idea how to select a dynamic date threshold. I'm at a loss.

  • 1
    Datetime operators are source-dependent, so you need to Edit the Question to specify the data type of the source. – Vince Nov 24 '19 at 4:28
  • I added the source file but I'm not sure how helpful that it is. Maybe I'm misunderstanding but whatever the source file is will be converted into a format ARCGIS can read for model builder – KotPB Nov 24 '19 at 5:09
  • 1
    "Feature class" isn't a data type. File geodatabase, personal geodatabase, enterprise geodatabase, shapefile,... are data formats. – Vince Nov 24 '19 at 5:30
  • I apologize. All of the data massaging takes place in a file geodatabase. I updated the post to reflect that. – KotPB Nov 24 '19 at 5:46
  • Sounds like you only need to use the select layer by attribute tool? This can be run in model builder and can be used to subset rows that conform to your date requirements. You would then pass the layer with its selection to Copy Rows tool to export he selection to a standalone table. – Hornbydd Nov 30 '19 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.