I am struggling to build a definition query using ArcGIS to select last updated record in relation to unique CADID (core data example below).
CADID is unique, updates recorded additional record in the FileGDB with same CADID with recent date and time stamp on it. I need to extract only unique record on (CADID) with last update.
Core dataset contains all records to keep track of historical updates but for current processing need only the latest updated record as follows.
I have heaps of datasets, and updates are happening to all datasets, manual selection is a real headache.
I applied different tricks without success. I can supply sample data to run the query.
arcpy.SearchCursor("YOUR_TABLE",'"lastupdate" = (SELECT MAX("lastupdate") from YOUR_TABLE)').next().cadid
. You need to specify YOUR_TABLE with your table/feature class name and use right field delimiters.