Find Missing Sequential Numbers in a Microsoft Access Table
Question details
Identify missing values in a sequential numeric field in an Access table.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A table contains numeric identifiers that are not AutoNumber values, and the user wants to find gaps in a specified sequence.
- Observed behavior
- The desired result is a list of missing numbers, such as 1304 when the table contains 1301, 1302, 1303, and 1305.
Identify the source table and numeric field, and decide the first and last numbers you want to check. Prepare a table containing every integer in that range, with a numeric field compatible with the source field.
Compare the Access table with a consecutive numbers table
Use an unmatched-record query to list every number in the chosen range that is absent from the source table.
A counters table supplies the expected numbers. A left join keeps every counters value and returns those with no matching value in the source table.
Create a table named Counters with a numeric field named Num, and populate it with every integer in the range to check. You can generate the values with VBA or import a spreadsheet through External Data.
In Access, select Create > Query Design, then switch to SQL View.
Enter: SELECT Counters.Num FROM Counters LEFT JOIN SourceTable ON Counters.Num = SourceTable.ID WHERE SourceTable.ID Is Null ORDER BY Counters.Num; Replace SourceTable and ID with your actual table and numeric field names.
Select Run to list the missing numbers. For example, a counters range of 1301 through 1305 returns 1304 if it is absent from the source field.

Review Sequential Numbers in WPS Spreadsheets
WPS Office is a free, lightweight Office alternative with a familiar interface for working with spreadsheet data. Open an exported Access data sheet to review number sequences and move between WPS and Microsoft Office formats easily. WPS does not run Access database queries.

Frequently Asked Questions
Does the numeric field need to be an AutoNumber field?
No. The query can compare an ordinary numeric field with the compatible numeric field in the counters table.
Can the query find several consecutive missing numbers?
Yes. If the counters table contains each expected integer, the query lists each missing value separately, including values in a longer gap.
Why is a number after the highest source value not listed?
The query only checks values in Counters. Add the expected number to the counters table and run the query again.
Can I import the counters table from Excel?
Yes. Put the consecutive numbers in an Excel column, then use Access's External Data options to import the worksheet as a table. Check that the imported field is numeric before joining it to the source field.




