-----Original Message-----
Dear Allan:
See below:
Tom,
It is very important that no numbers be missing, so I
would like to include the 468808 if possible. How can I
know that 468808 is also missing?
The query I provided should be read as reporting that ALL the numbers
from 468802 through 468804 are missing. That is meant to include
468803. It is a range. When only one consecutive number is missing,
you will have a range like from 999999 through 999999. When a hundred
consecutive rows are missing, you will get only one Start/End pair for
that.
In order to display every number missing in its own row of the table
you would probably need a table of all possible numbers. Given the
size of your numbers, this would be a huge table and the query may be
quite slow. Because of my experience with the missing number problem,
I recommend you try to use something of the form I showed you.
If I have the user choose the start and end of the series
on a form how would I incorporate that? Would this allow
468808 to be included?
I suggest you modify the subquery:
FROM (SELECT DISTINCT ItemNumber FROM Products) T
to read:
FROM (SELECT DISTINCT ItemNumber FROM Products
WHERE ItemNumber BETWEEN [StartOfSeries] AND [EndOfSeries]) T
and also change
AND ItemNumber < (SELECT MAX(ItemNumber) FROM Products)
to read
AND ItemNumber < (SELECT MAX(ItemNumber) FROM Products)
AND ItemNumber <= [EndOfSeries]
Form "ItemNumberInquiry"
Combo boxes on form "StartOfSeries" and "EndOfSeries".
I haven't used Queries other than those created by Access
very much so I am having some difficulty understanding how
the query works.
Are Products T1 and FROM Products) T different Tables?
No, T and T1 are aliases for two instances of the same table.
Are they variables that I need to declare?
No. I wrote and tested the query here exactly as I gave it. It is
complete and works.
What is the best way or a way to show the end user the
results (report, on screen)? Can I print the results?
As a query it can be shown on a form, in a report, put into a
spreadsheet, etc.
Thank you very much for your response and help.
Allan
showing
BeginSeries =
Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
.