SELECT T3.PM_CONTEXT_VALUE1 , T3.PM_AGENTID , T3.PM_AGENT_STRT_DTTM FROM PSPMTRANSHIST T3 WHERE T3.PM_TRANS_DEFN_ID = 116 AND PM_TRANS_STATUS = '1' AND PM_TRANS_DURATION <> 0 AND T3.PM_CONTEXT_VALUE1 IN ( SELECT T.PM_CONTEXT_VALUE1 FROM PSPMTRANSHIST T WHERE T.PM_TRANS_DEFN_SET = 1 AND T.PM_TRANS_DEFN_ID = 109 AND T.PM_MON_STRT_DTTM > %TimeAdd(%CurrentDateTimeIn, -720) AND T.PM_PARENT_INST_ID <> PM_TOP_INST_ID AND T.PM_CONTEXT_VALUE1 NOT IN ( SELECT T2.PM_CONTEXT_VALUE1 FROM PSPMTRANSHIST T2 WHERE T2.PM_TRANS_DEFN_SET = 1 AND T2.PM_TRANS_DEFN_ID = 108 AND T2.PM_CONTEXT_VALUE1 = T.PM_CONTEXT_VALUE1 AND T2.PM_MON_STRT_DTTM > %TimeAdd(%CurrentDateTimeIn, -720)))
|