If you are unable to create a new account, please email support@bspsoftware.com

 

Check the Oracle & pls suggest me how to devlop the report its urgent

Started by krishdw85, 04 Jun 2010 02:40:54 AM

Previous topic - Next topic

krishdw85

--------------------------------------------------------------------------------
  SELECT   SC CLIENTE, SUM (TOTAL) TOTAL
    FROM   (  SELECT   SITE_CODE SC, SUM (MO_NET_INCTV_AMT) TOTAL
                FROM   MXGFLVB1.RINYMXMO
               WHERE       MO_PROCESS_DT >= '2009-11-01'
                       AND MO_PROCESS_DT <= '2009-11-13'
                       AND SITE_CODE BETWEEN '01100' AND '09944'
            GROUP BY   SITE_CODE
            UNION
              SELECT   BA_CHG_TO_SITE_CD SC, SUM (BA_INV_TOT_AMT * -1) TOTAL
                FROM   MXGFLVB1.BASE_COMMON_DATA T1,
                       MXGFLVB1.BASE_NON_VEHICLE_BILLING_DATA T4
               WHERE       T1.BA_REC_SOURCE = T4.BA_REC_SOURCE
                       AND T1.BA_REC_TYPE = T4.BA_REC_TYPE
                       AND T1.BA_POINT_OF_SALE = T4.BA_POINT_OF_SALE
                       AND T1.BA_SEQ_NO = T4.BA_SEQ_NO
                       AND T1.BA_PRCS_TYP_CD = T4.BA_PRCS_TYP_CD
                       AND T1.BA_PRCS_TYP_CD = 'TR'
                       AND T1.BA_CURR_FING_TRMS_CD = 'X'
                       AND BA_BUSN_DATE >= '2009-11-01'
                       AND BA_BUSN_DATE <= '2009-11-13'
                       AND BA_CHG_TO_SITE_CD BETWEEN '01100' AND '09944'
            GROUP BY   BA_CHG_TO_SITE_CD
            UNION
              SELECT   BA_CHG_TO_SITE_CD SC, SUM (BA_INV_TOT_AMT * -1) TOTAL
                FROM   MXGFLVB1.BASE_COMMON_DATA T1,
                       MXGFLVB1.BASE_NON_VEHICLE_BILLING_DATA T4
               WHERE       T1.BA_REC_SOURCE = T4.BA_REC_SOURCE
                       AND T1.BA_REC_TYPE = T4.BA_REC_TYPE
                       AND T1.BA_POINT_OF_SALE = T4.BA_POINT_OF_SALE
                       AND T1.BA_SEQ_NO = T4.BA_SEQ_NO
                       AND T1.BA_PRCS_TYP_CD = T4.BA_PRCS_TYP_CD
                       AND T1.BA_PRCS_TYP_CD IN ('NC', 'ND')
                       AND T1.BA_CURR_FING_TRMS_CD = 'X'
                       AND BA_BUSN_DATE >= '2009-11-01'
                       AND BA_BUSN_DATE <= '2009-11-13'
                       AND BA_CHG_TO_SITE_CD BETWEEN '01100' AND '09944'
            GROUP BY   BA_CHG_TO_SITE_CD
            UNION
              SELECT   SITE_CODE CLIENTE, SUM (AMOUT * -1) TOTAL
                FROM   MXGFLVB1.MXLVBGLDAT
               WHERE       BA_BUSN_DATE BETWEEN '2009-11-01' AND '2009-11-13'
                       AND SITE_CODE BETWEEN '01100' AND '09944'
                       AND PROGRAM_ID = 'RARPI003'
                       AND ACCOUNT_NUMBER = '2A181000002000000000000000'
                       AND FINANCING_TERMS_CODE = 'X'
            GROUP BY   SITE_CODE)
GROUP BY   SC

blom0344

1. This is no Oracle forum..
2. How can we make report suggestions solely based on a piece of code?
3. Why do you base a report on straight SQL instead of a model?

krishdw85

@blom

Hi
Actualy in one of the report they did not provided any spec they juz given dis oracle and asked me 2 generate a report.
so i posted that query 2 analysis
anywayz thnkz every1

keep rocking every1

blom0344

Okay, I understand your predicament..

Now, for a better chance on getting feedback use regular english instead of phonetic slang (anywayz thnkz every1)  We are all professionals here   ;)

To get back on the subject. Without doing a check on your code , what is the problem?