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
>
>Jim,
>
>I'm not sure I understand you correctly but would this work for you (pseudo code)?
SELECT partno, MAX(GOMONTH(YYYYMM, 1)) AS lastmonsplusone ;
>...
>GROUP BY partno
>
Jim Nelson
Newbury Park, CA