Forum Discussion

Markpowell1969's avatar
Markpowell1969
Occasional Reader
Aug 24, 2026
Solved

how do i bring back just the last update records

hi. i have around 31k records, they all have a company name and unique id. but there in the table multiple times, but all with a date and time stamp. is there a way to bring just the latest updates into a query?

 

 

thanks in anticipation

  • You have about 31,000 Access rows, with repeated company or ID values and a timestamp, and need the complete row for each ID’s latest update. Use two queries rather than Last, because Last does not reliably mean the newest timestamp. In Query Design, add the table, select Totals, group by company and unique ID, and set the timestamp column to Max. Save this query as LatestPerID. Create a second query containing the original table and LatestPerID. Join company to company, ID to ID, and the original timestamp to the calculated maximum timestamp, then add the original table’s fields to the output. The result returns each group’s newest row. If two rows share the maximum timestamp, both appear, so add an AutoNumber key and define a tie-breaker. Index the ID and timestamp fields for performance, and verify known companies before changing any report or form to use the new query.

1 Reply

  • You have about 31,000 Access rows, with repeated company or ID values and a timestamp, and need the complete row for each ID’s latest update. Use two queries rather than Last, because Last does not reliably mean the newest timestamp. In Query Design, add the table, select Totals, group by company and unique ID, and set the timestamp column to Max. Save this query as LatestPerID. Create a second query containing the original table and LatestPerID. Join company to company, ID to ID, and the original timestamp to the calculated maximum timestamp, then add the original table’s fields to the output. The result returns each group’s newest row. If two rows share the maximum timestamp, both appear, so add an AutoNumber key and define a tie-breaker. Index the ID and timestamp fields for performance, and verify known companies before changing any report or form to use the new query.