Others

Find Missing Sequential Numbers in a Microsoft Access Table

Khadija KhanKhadija Khan Nov 22, 2026 869 views

Question details

Identify missing values in a sequential numeric field in an Access table.

Find Missing Sequential Numbers in a Microsoft 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.
Before you start

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.

Solution 1Recommended

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.

1
Prepare the counters 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.

2
Open SQL View

In Access, select Create > Query Design, then switch to SQL View.

3
Enter the unmatched query

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.

4
Run the query

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.

Compare the Access table with a consecutive numbers table
Choose the range deliberately: The query only checks numbers present in Counters. To detect missing values beyond the source table's current highest value, include those expected values in the counters table.
Free Microsoft Office alternative

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.

Sort exported numeric values to review sequence gaps in WPS SpreadsheetsOpen and edit Microsoft Excel XLSX filesUse a familiar spreadsheet interface for an easy transitionWork with a free, lightweight Office suite
microsoft office alternative - wps office

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.