Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
(qvd);
Left Join
LOAD TicketID,
InDateTime
FROM
(qvd);
Left Join(Table)
LOAD TicketID,
ENG_OUT_TIME
FROM
(qvd) WHERE MATCH(UPPER(STATUS),'CLOSED','TELE CLOSURE','MACHINE UNDER OBSERVATION');
PFA.
Regards
Av7eN
You can use FirstSortedValue to get min and max date
First Sorted Value is nice But the Code I am using is the right Approach or not.
Kindly Suggest.
Hi,
Use the code like in the attachments...
If you don't need other than Min value, then you calculate Min before Join
LOAD TicketID,
Min(InDateTime)
FROM
(qvd)
Group By TicketID;