>First of all, I apologize for not previewing my original message, which is embarrassing. This is what I meant to say:
>-------------------
>A simple case: I have a table with two relevant fields, {partno} and {month} (month is represented as YYYYMM). This table has history for each part, starting from the current month and going back to some date in the foggy past.
>
>For each partno, how do I determine the last {month} for each part that is NOT found in the table?
>-------------------
>
>If I have history for 200403, 200405, 200408, 200410, 200411, and 200412, for instance, I would be looking for 200409, which is the most recent month for which there is no data for this part.
Jim,
Couple more questions.
- If, in your example data for 200412 wasn't present, would be 200409 what you're looking for or it would be 200412? IOW, is the last month that has to be present is based on fixed date (200412) or on the last record for particular partno.
- How far back you want to look for missing month?
--sb--