SQL Exec: Effective Dated Query

 SQLEXEC("Select A.JOBCODE from PS_JOB A WHERE A.EMPLID = :1 AND 
A.EFFDT = (select max(B.effdt) from PS_JOB B WHERE B.EMPLID = A.EMPLID 
AND B.EMPL_RCD = A.EMPL_RCD AND B.EFFDT <=SYSDATE) AND 
A.EFFSEQ = (SELECT MAX(C.EFFSEQ) FROM PS_JOB C WHERE 
C.EMPLID= A.EMPLID AND C.EMPL_RCD = A.EMPL_RCD AND 
C.EFFDT = A.EFFDT)",&Emplid, &Jobcode);

Comments

Popular posts from this blog

BI Publisher: If Condition with sub-string in rtf template