Re: Missing Numbers
From: AHopper (anonymous_at_discussions.microsoft.com)
Date: 03/31/04
- Next message: maggie: "Re: query from 2 tables"
- Previous message: Gerald Stanley: "Re: Find records without any corresponding record in another table"
- In reply to: Tom Ellison: "Re: Missing Numbers"
- Next in thread: Tom Ellison: "Re: Missing Numbers"
- Reply: Tom Ellison: "Re: Missing Numbers"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 31 Mar 2004 10:51:07 -0800
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?
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?
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?
Are they variables that I need to declare?
What is the best way or a way to show the end user the
results (report, on screen)? Can I print the results?
Thank you very much for your response and help.
Allan
>-----Original Message-----
>Dear Allan:
>
>SELECT ItemNumber + 1 AS BeginSeries,
> (SELECT MIN(ItemNumber) - 1 FROM Products T1
> WHERE T1.ItemNumber > T.ItemNumber) AS EndSeries
> FROM (SELECT DISTINCT ItemNumber FROM Products) T
> WHERE NOT EXISTS (SELECT * FROM Products T1
> WHERE T1.ItemNumber = T.ItemNumber + 1)
> AND ItemNumber < (SELECT MAX(ItemNumber) FROM
Products)
>
>This will give you one row for your sample data, showing
BeginSeries =
>468802 and EndSeries = 468804, meaning numbers 468802
through 468804
>are missing. Close enough?
>
>Tom Ellison
>Microsoft Access MVP
>Ellison Enterprises - Your One Stop IT Experts
>
>
>On Wed, 31 Mar 2004 09:32:23 -0800, "AHopper"
><anonymous@discussions.microsoft.com> wrote:
>
>>I would like to find missing numbers and then print or
>>display the results. It is alright for numbers to be
>>entered more than once but numbers should not be missing.
>>
>>Table: Products
>>ItemNumbers
>>468800
>>468801
>>468801
>>468805
>>468806
>>468807
>>468807
>>468809
>>468810
>>
>>Missing Numbers 468802, 468803, 468804, and 468808
>>
>>Thank you in advance for your help.
>>
>>Allan
>>
>
>.
>
- Next message: maggie: "Re: query from 2 tables"
- Previous message: Gerald Stanley: "Re: Find records without any corresponding record in another table"
- In reply to: Tom Ellison: "Re: Missing Numbers"
- Next in thread: Tom Ellison: "Re: Missing Numbers"
- Reply: Tom Ellison: "Re: Missing Numbers"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|