SELECT A.*
FROM (SELECT (SELECT MAX (DOC_SEQUENCE_VALUE)
FROM GL_JE_BATCHES GJB, GL_JE_HEADERS GJH
WHERE GJB.JE_BATCH_ID = GJH.JE_BATCH_ID
AND GJB.JE_BATCH_ID =
(SELECT REVERSE(SUBSTR (
REVERSE (ITEM_KEY),
6,
LENGTH (ITEM_KEY)
))
FROM DUAL))
DOC_SEQUENCE_VALUE,
(SELECT NAME
FROM GL_JE_BATCHES
WHERE JE_BATCH_ID =
(SELECT REVERSE(SUBSTR (REVERSE (ITEM_KEY),
6,
LENGTH (ITEM_KEY)))
FROM DUAL))
BATCH_NAME,
(SELECT JE_BATCH_ID
FROM GL_JE_BATCHES
WHERE JE_BATCH_ID =
(SELECT REVERSE(SUBSTR (REVERSE (ITEM_KEY),
6,
LENGTH (ITEM_KEY)))
FROM DUAL))
JE_BATCH_ID,
MESSAGE_NAME,
STATUS,
TO_USER,
SUBJECT
FROM WF_NOTIFICATIONS B
WHERE MESSAGE_TYPE = 'GLBATCH'
AND MESSAGE_NAME = 'NO_MANAGER_RESPONSE'
AND STATUS = 'OPEN'
OR BEGIN_DATE LIKE TO_DATE ('09082005', 'dd/mm/yyyy')
OR B.RECIPIENT_ROLE LIKE '%Approver_name%') A,
GL_JE_BATCHES B
WHERE A.JE_BATCH_ID = B.JE_BATCH_ID AND B.STATUS != 'P'
No comments:
Post a Comment