4 Replies Latest reply: Oct 16, 2014 7:18 AM by anbu cheliyan RSS

    Min In DateTime  &  Max Out DateTime against Distinct TicketID in the Best Possible Way

    AVIRAL NAG

      Hi All

       

      I have to find Min In DateTime  Max Out DateTime against Distinct TicketID

      Below I am using the Code to find Min & Max Date.

      My Questions are:

      1) Is the code I am using is the correct way

      2) Is there any other alternate way

      3) Can I use First Sorted Value

       

      See my Code:

       

      Table:
      LOAD TicketID,
           SerialNumber,
           CreationDateTime
      FROM
      [C:\Users\CIPL-BIAdmin\Desktop\14 Oct 14\SampleTestFile.qvd]
      (qvd);

       

      Left Join

       

      LOAD TicketID,
           InDateTime
      FROM
      [C:\Users\CIPL-BIAdmin\Desktop\14 Oct 14\InTime.qvd]
      (qvd);

       

      Left Join(Table)

       

      LOAD TicketID,
           ENG_OUT_TIME
      FROM
      [C:\Users\CIPL-BIAdmin\Desktop\14 Oct 14\OutTime.qvd]
      (qvd) WHERE MATCH(UPPER(STATUS),'CLOSED','TELE CLOSURE','MACHINE UNDER OBSERVATION');

       

       

       

       

       

       

      PFA.

       

       

      Regards

      Av7eN