There is nothing more frustrating in working with a GDB FC/Table then dealing with a date field.
I am simply trying to run a Select Layer by Attribute tool via Python to select the most recent date in a file GDB feature class in a date field type. All my research have failed in being successful.
I have a Make Feature Layer and Select Layer by Attribute tool.
The recent expression:
arcpy.management.SelectLayerByAttribute(SURVEY123_EWO_REGULAR_HOURS_FL, "NEW_SELECTION", "date_ewo = (SELECT MAX(date_ewo) FROM SURVEY123_EWO_REGULAR_HOURS)")
Presently, I have (3) entries in the Feature Layer and still the selection exports all (3) entries versus just (1). In the future, this FC is going to grow and I need to be able to select the most recent entry each time I run the tool.
Appreciate any help