2 Replies Latest reply: Dec 8, 2015 1:37 AM by jhonatan ben ami RSS

    Syntax error, missing/misplaced

    jhonatan ben ami

      Hey everyone,

      i am writing the following script :

      // משלוחים והחזרות

      Returns:

      Load

      //כותרת מסמכים

      TRANS_TYPE,

      TRANS_CURDATE,

      (if(TRANS_TYPE='X',TRANS_IVCUST,TRANS_CUST))AS TRANS_CUST,

      TRANS_BRANCH,

      TRANS_DOCNO,

      TRANS_IVNUM,

      (if(TRANS_TYPE='X',TRANS_IVAGENT,TRANS_DOCAGENT)) AS TRANS_AGENT,

      TRANS_PART,

      TRANS_IVCOST,

      TRANS_IVIEXCHANGE,

      TRANS_IVPRICE ,

        

      //שורות

      TRANS_TQUANT,

      TRANS_IVTQUANT,

       

      // //מחירים משורות התעודה

       

       

      //מחיר בשקלים- שורות תעודת המשלוח

      IF(TRANS_TYPE= 'X',NIS_TRANS_IVPRICE,

       

       

      (TRANS_PRICE * TRANS_TQUANT) * (100 - TRANS_PERCENT)/100 *  (IF (TRANS_TYPE='N',(-1),1)) *

      TRANS_IEXCHANGE * (100 - TRANS_DOCPERCENT)/100)

      AS NIS_TRANS_TOTPRICE,

       

      // //מחיר בדולרים משורת תעודה     

      IF(TRANS_TYPE= 'X',NIS_TRANS_IVPRICE,

      (TRANS_PRICE * TRANS_TQUANT) * (100 - TRANS_PERCENT)/100 *  (IF (TRANS_TYPE='N',(-1),1)) *

      TRANS_IEXCHANGE * (100 - TRANS_DOCPERCENT)/100)

      /

      (IF(CURREG_EXCHANGE2  > 0 ,CURREG_EXCHANGE2 , CUR_EXCHANGE2) )

      AS DOLLAR_TRANS_TOTPRICE,

       

      // //מחיר במטבע שלישי משורת התעודה

      // IF(TRANS_TYPE= 'X',NIS_TRANS_IVPRICE,

      // (TRANS_PRICE * TRANS_TQUANT) * (100 - TRANS_PERCENT)/100 *  (IF (TRANS_TYPE='N',(-1),1)) *

      // TRANS_IEXCHANGE * (100 - TRANS_DOCPERCENT)/100)

      // /

      // (IF(CURREG_EXCHANGE3  > 0 ,CURREG_EXCHANGE3 , CUR_EXCHANGE3) )

      // AS CURRENCY_TRANS_TOTPRICE,

      //   //שיניתי בכדי להוריד את  הtrans_comp

      //  (if(TRANS_TYPE='X',TRANS_IVCUST,TRANS_CUST))& '_' & (if(TRANS_TYPE='X',TRANS_IVAGENT,TRANS_DOCAGENT))& '_' & TRANS_BRANCH&'_' & TRANS_PART  & '_'& TRANS_CURDATE  AS SALES_KEY

       

      Resident Returns_tmp

      Where TRANS_CURDATE >= '01/01/2010';

      // and TRANS_TARUCHA <> 'Y'

      DROP Table Returns_tmp;

       

      and i am getting the following error:

       

      Syntax error, missing/misplaced FROM: Returns: Load TRANS_TYPE, TRANS_CURDATE, (if(TRANS_TYPE='X',TRANS_IVCUST,TRANS_CUST))AS TRANS_CUST, TRANS_BRANCH, TRANS_DOCNO, TRANS_IVNUM, (if(TRANS_TYPE='X',TRANS_IVAGENT,TRANS_DOCAGENT)) AS TRANS_AGENT, TRANS_PART, TRANS_IVCOST, TRANS_IVIEXCHANGE, TRANS_IVPRICE , TRANS_TQUANT, TRANS_IVTQUANT, IF(TRANS_TYPE= 'X',NIS_TRANS_IVPRICE, (TRANS_PRICE * TRANS_TQUANT) * (100 - TRANS_PERCENT)/100 * (IF (TRANS_TYPE='N',(-1),1)) * TRANS_IEXCHANGE * (100 - TRANS_DOCPERCENT)/100) AS NIS_TRANS_TOTPRICE, IF(TRANS_TYPE= 'X',NIS_TRANS_IVPRICE, (TRANS_PRICE * TRANS_TQUANT) * (100 - TRANS_PERCENT)/100 * (IF (TRANS_TYPE='N',(-1),1)) * TRANS_IEXCHANGE * (100 - TRANS_DOCPERCENT)/100) / (IF(CURREG_EXCHANGE2 > 0 ,CURREG_EXCHANGE2 , CUR_EXCHANGE2) ) AS DOLLAR_TRANS_TOTPRICE, Resident Returns_tmp Where TRANS_CURDATE >= '01/01/2010': Returns: Load TRANS_TYPE, TRANS_CURDATE, (if(TRANS_TYPE='X',TRANS_IVCUST,TRANS_CUST))AS TRANS_CUST, TRANS_BRANCH, TRANS_DOCNO, TRANS_IVNUM, (if(TRANS_TYPE='X',TRANS_IVAGENT,TRANS_DOCAGENT)) AS TRANS_AGENT, TRANS_PART, TRANS_IVCOST, TRANS_IVIEXCHANGE, TRANS_IVPRICE , TRANS_TQUANT, TRANS_IVTQUANT, IF(TRANS_TYPE= 'X',NIS_TRANS_IVPRICE, (TRANS_PRICE * TRANS_TQUANT) * (100 - TRANS_PERCENT)/100 * (IF (TRANS_TYPE='N',(-1),1)) * TRANS_IEXCHANGE * (100 - TRANS_DOCPERCENT)/100) AS NIS_TRANS_TOTPRICE, IF(TRANS_TYPE= 'X',NIS_TRANS_IVPRICE, (TRANS_PRICE * TRANS_TQUANT) * (100 - TRANS_PERCENT)/100 * (IF (TRANS_TYPE='N',(-1),1)) * TRANS_IEXCHANGE * (100 - TRANS_DOCPERCENT)/100) / (IF(CURREG_EXCHANGE2 > 0 ,CURREG_EXCHANGE2 , CUR_EXCHANGE2) ) AS DOLLAR_TRANS_TOTPRICE, Resident Returns_tmp Where TRANS_CURDATE >= '01/01/2010'