RonVolkmar
Programmer
I have aircraft parts inventory program that uses a SQL7.0 DB. One table is Transactions which contains part numbers, date, type, serial numbers, and shelflife date among others. Typical types are RECEIVE, REMOVE, and ISSUE. The shelflife date is important when the part is on the shelf, but once issued or shipped out for repair, the part does not have a shelflife. However, it can return to the shelf and then it gets a shelflife again. Typical data is below.
part date type serial# shelflife
9930 2002-12-17 REMOVE 1635-2 2003-12-31
9930 2002-12-17 SHIP 1635-2 NULL
9930 2002-12-24 RECEIVE 1635-2 2003-12-31
9930 2003-01-06 ISSUE 1635-2 NULL
9930 2003-08-11 REMOVE 1635-2 2004-08-31
9930 2003-08-11 SHIP 1635-2 NULL
9930 2003-08-19 RECEIVE 1635-2 2004-08-31
9930 2003-08-28 ISSUE 1635-2 NULL
I am having trouble generating a shelflife report. A "SELECT....Max(Shelflife)", works but returns a shelflife even when the part has been issued (TYPE = ISSUE).
Thanks in advance for any suggestions on how to return a Shelflife date when the TYPE is other than ISSUE, but still return the latest shelflife date for a given part and serial number?
Ron
part date type serial# shelflife
9930 2002-12-17 REMOVE 1635-2 2003-12-31
9930 2002-12-17 SHIP 1635-2 NULL
9930 2002-12-24 RECEIVE 1635-2 2003-12-31
9930 2003-01-06 ISSUE 1635-2 NULL
9930 2003-08-11 REMOVE 1635-2 2004-08-31
9930 2003-08-11 SHIP 1635-2 NULL
9930 2003-08-19 RECEIVE 1635-2 2004-08-31
9930 2003-08-28 ISSUE 1635-2 NULL
I am having trouble generating a shelflife report. A "SELECT....Max(Shelflife)", works but returns a shelflife even when the part has been issued (TYPE = ISSUE).
Thanks in advance for any suggestions on how to return a Shelflife date when the TYPE is other than ISSUE, but still return the latest shelflife date for a given part and serial number?
Ron