This discussion is archived
1 Reply Latest reply: Feb 12, 2013 3:21 AM by AhamedRafeeque RSS

Getting Error while running this query

968940 Newbie
Currently Being Moderated
Hi,

SELECT SUM(BATCHWISE_COUNT) TOTALBATCHCOUNT,
     TO_CHAR(SUM(BATCHWISEAMOUNT),'9,99,99,99,99,99,99,99,990.99') TOTALAMOUNT ,
     SUM(SLIP_RECORDS) TOTALSLIPCOUNT,
     SUM(CHEQUEONLY_RECORD) TOTALCHEQUECOUNT
from (SELECT COUNT(TI.FLDITEMINITIALID) BATCHWISE_COUNT from TBLITEMINITIAL TI),
(select SUM(IT.FLDAMOUNT)/100 BATCHWISEAMOUNT from TBLITEMINFOTRANS IT ),
(SELECT COUNT(FLDITEMINITIALID) FROM TBLITEMINITIAL TI WHERE FLDBATCHNUMBER NOT IN (select FLDBATCHNUMBER from TBLITEMINITIAL_DEL where TI.FLDCAPTURINGDATE=FLDCAPTURINGDATE) AND TI.FLDITEMTYPE = 'P' AND TI.FLDCAPTURINGMODE = 'CP') SLIP_RECORDS,
(SELECT COUNT(FLDITEMINITIALID) FROM TBLITEMINITIAL TI WHERE FLDBATCHNUMBER NOT IN (select FLDBATCHNUMBER from TBLITEMINITIAL_DEL where TI.FLDCAPTURINGDATE=FLDCAPTURINGDATE) AND FLDITEMTYPE = 'C' AND FLDCAPTURINGMODE = 'CO') CHEQUEONLY_RECORD
from TBLITEMINITIAL TI,
               TBLITEMINFO II,
               TBLITEMINFOTRANS IT
          WHERE     II.FLDITEMINITIALID                    = TI.FLDITEMINITIALID
          AND     II.FLDITEMID                         = IT.FLDITEMID
          GROUP BY TRUNC(TI.FLDCAPTURINGDATE),TI.FLDBATCHNUMBER,TI.FLDCAPTURINGBRANCH,TI.FLDSCANNERID)

Im geeting error
ORA-00933: SQL command not properly ended
when running this query

I don't know what mistake i have done in this query , Kindly help for solving this issue

Thanks

Bala,

Edited by: 965937 on Feb 11, 2013 9:25 PM
  • 1. Re: Getting Error while running this query
    AhamedRafeeque Newbie
    Currently Being Moderated
    Dear Friend

    Try with the query below,

    <<
    SELECT SUM(BATCHWISE_COUNT) TOTALBATCHCOUNT,
    TO_CHAR(SUM(BATCHWISEAMOUNT),'9,99,99,99,99,99,99,99,990.99') TOTALAMOUNT ,
    SUM(SLIP_RECORDS) TOTALSLIPCOUNT,
    SUM(CHEQUEONLY_RECORD) TOTALCHEQUECOUNT
    from (SELECT COUNT(TI.FLDITEMINITIALID) BATCHWISE_COUNT from TBLITEMINITIAL TI),
    (select SUM(IT.FLDAMOUNT)/100 BATCHWISEAMOUNT from TBLITEMINFOTRANS IT ),
    (SELECT COUNT(FLDITEMINITIALID) FROM TBLITEMINITIAL TI WHERE FLDBATCHNUMBER NOT IN (select FLDBATCHNUMBER from TBLITEMINITIAL_DEL where TI.FLDCAPTURINGDATE=FLDCAPTURINGDATE) AND TI.FLDITEMTYPE = 'P' AND TI.FLDCAPTURINGMODE = 'CP') SLIP_RECORDS,
    (SELECT COUNT(FLDITEMINITIALID) FROM TBLITEMINITIAL TI WHERE FLDBATCHNUMBER NOT IN (select FLDBATCHNUMBER from TBLITEMINITIAL_DEL where TI.FLDCAPTURINGDATE=FLDCAPTURINGDATE) AND FLDITEMTYPE = 'C' AND FLDCAPTURINGMODE = 'CO') CHEQUEONLY_RECORD
    from TBLITEMINITIAL TI,
    TBLITEMINFO II,
    TBLITEMINFOTRANS IT
    WHERE II.FLDITEMINITIALID = TI.FLDITEMINITIALID
    AND II.FLDITEMID = IT.FLDITEMID
    GROUP BY TRUNC(TI.FLDCAPTURINGDATE),TI.FLDBATCHNUMBER,TI.FLDCAPTURINGBRANCH,TI.FLDSCANNERID;


    Regards
    Ahamed Rafeeque Cherkala

    Edited by: Ahamed Rafeeque on Feb 12, 2013 3:20 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points