2 Replies Latest reply on Jan 15, 2019 8:23 PM by EdStevens

    SQL Serve to SQL Developer

    3867494

      Hello,

      Would you mind to help me to convert the below SQL Server query to SQL Developer?

      Thank you.

      Regards,

       

       

      SELECT Company=RPKCO,

      CustomerNumber=LTRIM(STR(ABAN8)),

      NameAlpha=LTRIM(RTRIM(ABALPH)),

      CustomerType=AIAC01,

      DocumentNumber=CONVERT(int,RPDOC),

      Currency=RPCRCD,

      DocumentType=RPDCT,

      InvoiceDate=(RPDIVJ),

      GLDate=(RPDGJ),

      DueDate=(RPDDJ),

      PaymentStatus=RPPST,

      GrossAmount=CONVERT(float, RPAG/100),

      OpenOnAsOfDate=CONVERT(float, (RPAG + ISNULL(RZPAAP+RZADSA+RZAAAJ,0))/100),

      DateInvoiceClosed=(RPJCL),

      Tax=CONVERT(float, RPSTAM/100),

      TaxArea=RPTXA1,

      Remark=RPRMK

      FROM F03B11

      LEFT JOIN F0101 ON F0101.ABAN8=RPAN8

      LEFT JOIN F03012 ON AIAN8=ABAN8 AND AICO=RPCO

      OUTER APPLY ( SELECT RZPAAP=SUM(RZPAAP),

      RZADSA=SUM(RZADSA),

      RZAAAJ=SUM(RZAAAJ)

      FROM F03B14

      WHERE F03B14.RZKCO=F03B11.RPKCO AND

      F03B14.RZDCT=F03B11.RPDCT AND

      F03B14.RZDOC=F03B11.RPDOC AND

      F03B14.RZSFX=F03B11.RPSFX AND

      F03B14.RZDGJ<=118364 ) x

      WHERE RPKCO IN ('10000') AND

      RPDCT IN ('HI', 'HC', 'HA', 'HE', 'HD') AND

      RPAG<>0 AND

      RPDGJ <= 118364  and RPDOC='10000000'

       

      ORDER BY RPAN8,RPDOC