--All Outbound Requests--
SELECT
SCR.REQ_NUM AS 'Request #'
,SCR.STATUS_CD AS 'Status'
--,SCR.CM_SRVR_COMP_NAME AS 'Component Name'
--,SCR.NAME AS 'Description'
,SCR.STATUS_MSG AS 'Status Message'
--,SCR.DFLT_MEDIUM_CD AS 'Default Preference'
--, AS 'Recipient Group'
,SCR.PROC_START_DT AS 'Start Time'
,SCR.PROC_END_DT AS 'End Time'
,SCR.CREATED AS 'Created'
,SCRU.LOGIN AS 'Created By'
--,SCR.COMMENTS AS 'Comments'
--Comm Request Source--
,SCRS.SRC_ROW_ID AS 'Id'
--Comm Package--
,SDCP.NAME AS 'Name'
,SDCP.MEDIA_TYPE_CD AS 'Channel Type'
--Request Recipient Source
--,RCS.ROW_ID
,RCS.SR_NUM AS 'SR No'
--Customer Record
,(ISNULL(CUS.FST_NAME, '') + ' ' + ISNULL(CUS.MID_NAME, '') + ' ' + ' ' + ISNULL(CUS.LAST_NAME, '')) AS 'Name ENU'
FROM S_COMM_REQ SCR --Comm Parent Request
LEFT JOIN S_USER SCRU ON SCRU.PAR_ROW_ID = SCR.CREATED_BY -- Comm Parent Request Created By
LEFT JOIN S_COMM_REQ_SRC SCRS ON SCRS.COMM_REQ_ID = SCR.ROW_ID -- Comm Request Source
LEFT JOIN S_COMM_REQ_PKG SCRPIT ON SCRPIT.COMM_REQ_ID = SCR.ROW_ID -- Comm Request/Comm Package
LEFT JOIN S_DMND_CRTN_PRG SDCP ON SDCP.ROW_ID = SCRPIT.DCP_ID --Comm Package
LEFT JOIN S_COMM_REQ_SRC RCSI ON SCR.ROW_ID = RCSI.COMM_REQ_ID
LEFT JOIN S_SRV_REQ RCS ON RCS.ROW_ID = RCSI.SRC_ROW_ID --Request Recipient Source
LEFT JOIN S_CONTACT CUS ON CUS.ROW_ID = RCS.CST_CON_ID -- Customer Record
WHERE 1=1
ORDER BY SCR.CREATED DESC
SELECT
SCR.REQ_NUM AS 'Request #'
,SCR.STATUS_CD AS 'Status'
--,SCR.CM_SRVR_COMP_NAME AS 'Component Name'
--,SCR.NAME AS 'Description'
,SCR.STATUS_MSG AS 'Status Message'
--,SCR.DFLT_MEDIUM_CD AS 'Default Preference'
--, AS 'Recipient Group'
,SCR.PROC_START_DT AS 'Start Time'
,SCR.PROC_END_DT AS 'End Time'
,SCR.CREATED AS 'Created'
,SCRU.LOGIN AS 'Created By'
--,SCR.COMMENTS AS 'Comments'
--Comm Request Source--
,SCRS.SRC_ROW_ID AS 'Id'
--Comm Package--
,SDCP.NAME AS 'Name'
,SDCP.MEDIA_TYPE_CD AS 'Channel Type'
--Request Recipient Source
--,RCS.ROW_ID
,RCS.SR_NUM AS 'SR No'
--Customer Record
,(ISNULL(CUS.FST_NAME, '') + ' ' + ISNULL(CUS.MID_NAME, '') + ' ' + ' ' + ISNULL(CUS.LAST_NAME, '')) AS 'Name ENU'
FROM S_COMM_REQ SCR --Comm Parent Request
LEFT JOIN S_USER SCRU ON SCRU.PAR_ROW_ID = SCR.CREATED_BY -- Comm Parent Request Created By
LEFT JOIN S_COMM_REQ_SRC SCRS ON SCRS.COMM_REQ_ID = SCR.ROW_ID -- Comm Request Source
LEFT JOIN S_COMM_REQ_PKG SCRPIT ON SCRPIT.COMM_REQ_ID = SCR.ROW_ID -- Comm Request/Comm Package
LEFT JOIN S_DMND_CRTN_PRG SDCP ON SDCP.ROW_ID = SCRPIT.DCP_ID --Comm Package
LEFT JOIN S_COMM_REQ_SRC RCSI ON SCR.ROW_ID = RCSI.COMM_REQ_ID
LEFT JOIN S_SRV_REQ RCS ON RCS.ROW_ID = RCSI.SRC_ROW_ID --Request Recipient Source
LEFT JOIN S_CONTACT CUS ON CUS.ROW_ID = RCS.CST_CON_ID -- Customer Record
WHERE 1=1
ORDER BY SCR.CREATED DESC
Comments
Post a Comment