Others

Return the Latest Record for Each Serial Number in Microsoft Access

Jason MillerJason Miller Nov 25, 2026 869 views

Question details

Return one complete assessment record for each serial number based on the latest assessment date or the largest AutoNumber ID.

Return the Latest Record for Each Serial Number in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
An assessment table contains multiple records for each serial number, and the user needs the newest record for each one.
Observed behavior
The desired result is one complete row per serial number, with the ID resolving any ties on the latest date.
Before you start

Open the database in Access and identify the table name, serial number field, assessment date field, and unique AutoNumber field. Replace the example names in the SQL with your actual names, and decide whether the assessment date or the largest ID defines the newest record.

Solution 1Recommended

Return the latest assessment date with an ID tie-breaker

Use this method when the assessment date determines the latest record and the largest ID should resolve date ties.

The first query finds the latest assessment date for each serial number. The second joins those results to the original table and selects the largest ID when multiple records share that date.

1
Create the date summary query

In Access, select Create > Query Design, switch to SQL View, and enter: SELECT [SerialNumber], Max([AssessmentDate]) AS LatestDate FROM Assessments WHERE [SerialNumber] Is Not Null AND [AssessmentDate] Is Not Null GROUP BY [SerialNumber];

2
Save the summary query

Select Save and name the query qLatestAssessmentDate. Replace Assessments and the field names in the SQL if your database uses different names.

3
Create the complete-record query

Create another query in SQL View and enter: SELECT A.* FROM Assessments AS A INNER JOIN qLatestAssessmentDate AS Q ON (A.[SerialNumber] = Q.[SerialNumber]) AND (A.[AssessmentDate] = Q.[LatestDate]) WHERE A.[ID] = (SELECT Max(B.[ID]) FROM Assessments AS B WHERE B.[SerialNumber] = A.[SerialNumber] AND B.[AssessmentDate] = A.[AssessmentDate]);

4
Run and check the results

Select Run and verify that the results show one row per serial number and include all fields from the matching assessment record.

Return the latest assessment date with an ID tie-breaker
Check dates and IDs: The summary query excludes records with a blank serial number or assessment date. The ID must be unique; if the date field includes a time, the latest timestamp is used.
Free Microsoft Office alternative

Review exported assessment records in WPS Spreadsheets

WPS Office is a free, lightweight, easy-to-use alternative for working with spreadsheet exports. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files, although it does not run or repair Microsoft Access queries.

Review exported assessment records in a spreadsheetCompatible with Microsoft Excel XLS and XLSX filesFamiliar spreadsheet tools for sorting and filtering recordsLightweight office suite with a free version
microsoft office alternative - wps office

Frequently Asked Questions

Why does a maximum-date query return more than one row per serial number?

A join on serial number and date returns every record that shares the latest date. Add the maximum ID tie-breaker shown in the complete-record query to select one row.

Can I return all fields from the latest assessment record?

Yes. Join the saved maximum-date query back to the assessment table, then use SELECT A.* to return all fields from the matching table row.

What happens if an assessment date is blank?

The date-based example excludes blank dates with [AssessmentDate] Is Not Null. A serial number with no dated records will not appear in that query's results.

Should I use the latest date or the largest AutoNumber?

Use the date-based query when assessment date determines recency. Use the largest-ID query only when the largest AutoNumber is the intended definition of the latest record.

Does the date-based query consider the time of day?

Yes. If AssessmentDate contains both a date and a time, Max uses the complete date and time value. Records on the same calendar day can therefore have different values.