Albert3162
Programmer
Hi everybody,
I have proble to create report,
I've table wich is contains data for different report types,
How can I pool out data for each report in one select.
for example this a mane select.
SELECT Distinct W_AMC_MAIL_STATUS_MASTER_DATA.AMC_MAIL_MASTER_TXN_ID,
W_AMC_MAIL_STATUS_MASTER_DATA.AIRPORT_CODE,
W_AMC_MAIL_STATUS_MASTER_DATA.REPORTING_DATE,
W_AMC_MAIL_STATUS_MASTER_DATA.CONDITION_REMARKS,
W_AMC_MAIL_STATUS_MASTER_DATA.RESOLUTION_COMPLETE_STATUS,
W_AMC_MAIL_STATUS_DETAIL_DATA.CONTAINER_SEQ_NO,
W_AMC_CONTAINERS_REF.CONTAINER_TYPE,
W_AMC_MAIL_STATUS_DETAIL_DATA.NUMBER_OF_CONTAINERS,
W_AMC_MAIL_STATUS_DETAIL_DATA.MAIL_CLASS_CODE,
W_AMC_MAIL_STATUS_DETAIL_DATA.WEIGHT_IN_LBS ,
W_AMC_MAIL_STATUS_DETAIL_DATA.PLAN_FAIL_WEIGHT,
W_AMC_MAIL_STATUS_DETAIL_DATA.PLAN_FAIL_CONTAINERS,
(W_AMC_MAIL_STATUS_DETAIL_DATA.PLAN_FAIL_CONTAINERS * W_AMC_CONTAINERS_REF.NUMBER_OF_PIECES) PLAN_FAIL_MAIL_PCS
FROM W_AMC_MAIL_STATUS_MASTER_DATA,
W_AMC_MAIL_STATUS_DETAIL_DATA,
W_AMC_CONTAINERS_REF,
W_AMC_MAIL_CLASS_REF
WHERE (W_AMC_MAIL_STATUS_MASTER_DATA.AIRPORT_CODE = W_AMC_MAIL_STATUS_DETAIL_DATA.AIRPORT_CODE)
AND (W_AMC_MAIL_STATUS_MASTER_DATA.REPORT_TYPE = W_AMC_MAIL_STATUS_DETAIL_DATA.REPORT_TYPE)
AND (W_AMC_MAIL_CLASS_REF.MAIL_CLASS_CODE = W_AMC_MAIL_STATUS_DETAIL_DATA.MAIL_CLASS_CODE)
AND (W_AMC_CONTAINERS_REF.AMC_CONTAINER_SEQ_NO = W_AMC_MAIL_STATUS_DETAIL_DATA.CONTAINER_SEQ_NO)
AND (W_AMC_MAIL_STATUS_MASTER_DATA.REPORTING_DATE = W_AMC_MAIL_STATUS_DETAIL_DATA.REPORTING_DATE)
AND (W_AMC_MAIL_STATUS_MASTER_DATA.REPORT_TYPE in(2,3,4,5,6))
ORDER BY REPORTING_DATE
I need show PLAN_FAIL_WEIGHT for each REPORT_TYPE
Thank for help.
Albert.
I have proble to create report,
I've table wich is contains data for different report types,
How can I pool out data for each report in one select.
for example this a mane select.
SELECT Distinct W_AMC_MAIL_STATUS_MASTER_DATA.AMC_MAIL_MASTER_TXN_ID,
W_AMC_MAIL_STATUS_MASTER_DATA.AIRPORT_CODE,
W_AMC_MAIL_STATUS_MASTER_DATA.REPORTING_DATE,
W_AMC_MAIL_STATUS_MASTER_DATA.CONDITION_REMARKS,
W_AMC_MAIL_STATUS_MASTER_DATA.RESOLUTION_COMPLETE_STATUS,
W_AMC_MAIL_STATUS_DETAIL_DATA.CONTAINER_SEQ_NO,
W_AMC_CONTAINERS_REF.CONTAINER_TYPE,
W_AMC_MAIL_STATUS_DETAIL_DATA.NUMBER_OF_CONTAINERS,
W_AMC_MAIL_STATUS_DETAIL_DATA.MAIL_CLASS_CODE,
W_AMC_MAIL_STATUS_DETAIL_DATA.WEIGHT_IN_LBS ,
W_AMC_MAIL_STATUS_DETAIL_DATA.PLAN_FAIL_WEIGHT,
W_AMC_MAIL_STATUS_DETAIL_DATA.PLAN_FAIL_CONTAINERS,
(W_AMC_MAIL_STATUS_DETAIL_DATA.PLAN_FAIL_CONTAINERS * W_AMC_CONTAINERS_REF.NUMBER_OF_PIECES) PLAN_FAIL_MAIL_PCS
FROM W_AMC_MAIL_STATUS_MASTER_DATA,
W_AMC_MAIL_STATUS_DETAIL_DATA,
W_AMC_CONTAINERS_REF,
W_AMC_MAIL_CLASS_REF
WHERE (W_AMC_MAIL_STATUS_MASTER_DATA.AIRPORT_CODE = W_AMC_MAIL_STATUS_DETAIL_DATA.AIRPORT_CODE)
AND (W_AMC_MAIL_STATUS_MASTER_DATA.REPORT_TYPE = W_AMC_MAIL_STATUS_DETAIL_DATA.REPORT_TYPE)
AND (W_AMC_MAIL_CLASS_REF.MAIL_CLASS_CODE = W_AMC_MAIL_STATUS_DETAIL_DATA.MAIL_CLASS_CODE)
AND (W_AMC_CONTAINERS_REF.AMC_CONTAINER_SEQ_NO = W_AMC_MAIL_STATUS_DETAIL_DATA.CONTAINER_SEQ_NO)
AND (W_AMC_MAIL_STATUS_MASTER_DATA.REPORTING_DATE = W_AMC_MAIL_STATUS_DETAIL_DATA.REPORTING_DATE)
AND (W_AMC_MAIL_STATUS_MASTER_DATA.REPORT_TYPE in(2,3,4,5,6))
ORDER BY REPORTING_DATE
I need show PLAN_FAIL_WEIGHT for each REPORT_TYPE
Thank for help.
Albert.