18 Replies Latest reply: Jan 20, 2017 11:57 AM by Wallo Atkinson RSS

    Select only the most recent values

    Nick Reardon

      I'm not sure how to select the most recent value for presentation.

       

      I have a field called [ChangeDate] and a load script that looks like this.

       

      Left keep

      Table6:

      Load

      ChangeKeyValue as ITMSNumber,

      IF(ChangeNewValue='Quarantined - DSC', date(Today()) - Floor(date(TIMESTAMP(ChangeDate, 'YYYY-MM-DD hh.mm.ss.fff')))) as DaysPassed;

       

       

      SQL SELECT ChangeKeyValue,

      ChangeNewValue,

      ChangeDate

      FROM MPL.dbo."tblCHANGE";

       

      All I want is the most recent [ChangeNewValue] if they read "Quarantined - DSC".