PDA

View Full Version : Find missing numbers In a sequence using a query



Oblio
09-11-2017, 10:20 AM
20307

:banghead:
I have a table of numbers which I want to compare with the query results (q_Distinct_Folders_2.ConvertedFolderNumber) which shows the current sequence used and recorded.
Here is the table:

lt_Numbers
Numbers_ID PK, Autonumber
Number Integer

lt_Numbers contains numbers from 1 to 500

q_Distinct_Folders_2
Shows all of the existing Folder Numbers in the expression ConvertedFolderNumber.
It is easy to see that folder 11, 12, 14, 18, are missing in the query q_Distinct_Folders_2
How can I get the query to return the results: 11,12.14,18 ?
I do not want a range of numbers if there are sequential missing folders. For example, I do not want a High/Low type range…
i.e. from 11 to 13 to describe records 11, 12 missing… I want each individual folder missing listed as such.
Also, as the number of total folders in the sequence changes from day to day, and so I need to limit the lt_Numbers comparison to numbers less than and equal to the number in q_Distinct_Folders_2.

Any help appreciated !!!!!

OBP
09-12-2017, 01:03 AM
When creating a second query, based on the table and query for comparison in the Query Wizard select "Find Unmatched Query Wizard".