|
Note that this probably will _NOT_ give you what you are looking for.
If # 7,8,9 are missing, the only one you'll get returned is 7.
Jonathan Mason wrote:
Not to worry, I managed it with the help of the News/400 Desktop Guide
to SQL and came up with:
SELECT A.INVNO
FROM INVHDR AS A
EXCEPTION JOIN INVHDR AS B
ON A.INVNO = B.INVNO + 1
I'm so impressed, now it's time to go home.
Jonathan Mason wrote:
<<SNIP>>
Is it possible using SQL to generate a list of invoice numbers where the
next invoice number doesn't exist. For example, if invoice numbers 1,
2, 3, 6, 7, 11, 12 and 15 existed the list would show 3, 7, 12 and 15
(although I'm not too worried about the last one). <<SNIP>>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.