5 Replies Latest reply: Nov 30, 2015 6:12 AM by Sunny Talwar RSS

    missing/misplaced FROM

    jhonatan ben ami

      Hey everyone i am getting the following erroe but i don't realiy understand the problem



      Syntax error, missing/misplaced FROM: INV_SALES: LOAD CUST_CUST AS INV_CUST, INV_IVDATE AS IVDATE, INV_INVNUM, CUST_AGENTNAME AS INV_AGENTNAME, IV_AGENT, IV_BRANCH, INV_TYPE, IV_PART, TRANS_COST, IV_QUANT, IV_QUANT*IF(DEBIT ='C',-1,1) AS RIV_QUANT, IV_PERCENT, IV_COMMISSION, IV_IVCOST, (IF(ISNULL(IV_TRANS) =-1,0,IV_TRANS)) AS IV_TRANS, IV_CREDITFLAG, (IF(DEBIT='C',(-1),1)) AS IVCAL_CREDIT, (IV_IVCOST * (IF (DEBIT ='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3 = INV_CURRENCY,FNC_EXCHANGE3, if(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) AS NIS_TOTPRICE, (IV_IVCOST * (IF (DEBIT='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3=INV_CURRENCY,FNC_EXCHANGE3, IF(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) / IF(FNC_EXCHANGE2 > 0 , FNC_EXCHANGE2, IF(CURREG_EXCHANGE2 > 0 , CURREG_EXCHANGE2 , CUR_EXCHANGE2)) AS DOLLAR_TOTPRICE, נבדק לא פה השגיאה של הדי באגר (IV_IVCOST * (IF (DEBIT='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3 = INV_CURRENCY,FNC_EXCHANGE3, IF(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) / IF(CURREG_EXCHANGE3 > 0 , CURREG_EXCHANGE3 , CUR_EXCHANGE3) AS CURRENCY_TOTPRICE, CUST_CUST&'_'&IV_AGENT&'_'&IV_BRANCH&'_'&IV_PART&'_'&INV_IVDATE AS SALES_KEY RESIDENT INV_SALES_TEMP : INV_SALES: LOAD CUST_CUST AS INV_CUST, INV_IVDATE AS IVDATE, INV_INVNUM, CUST_AGENTNAME AS INV_AGENTNAME, IV_AGENT, IV_BRANCH, INV_TYPE, IV_PART, TRANS_COST, IV_QUANT, IV_QUANT*IF(DEBIT ='C',-1,1) AS RIV_QUANT, IV_PERCENT, IV_COMMISSION, IV_IVCOST, (IF(ISNULL(IV_TRANS) =-1,0,IV_TRANS)) AS IV_TRANS, IV_CREDITFLAG, (IF(DEBIT='C',(-1),1)) AS IVCAL_CREDIT, (IV_IVCOST * (IF (DEBIT ='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3 = INV_CURRENCY,FNC_EXCHANGE3, if(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) AS NIS_TOTPRICE, (IV_IVCOST * (IF (DEBIT='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3=INV_CURRENCY,FNC_EXCHANGE3, IF(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) / IF(FNC_EXCHANGE2 > 0 , FNC_EXCHANGE2, IF(CURREG_EXCHANGE2 > 0 , CURREG_EXCHANGE2 , CUR_EXCHANGE2)) AS DOLLAR_TOTPRICE, נבדק לא פה השגיאה של הדי באגר (IV_IVCOST * (IF (DEBIT='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3 = INV_CURRENCY,FNC_EXCHANGE3, IF(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) / IF(CURREG_EXCHANGE3 > 0 , CURREG_EXCHANGE3 , CUR_EXCHANGE3) AS CURRENCY_TOTPRICE, CUST_CUST&'_'&IV_AGENT&'_'&IV_BRANCH&'_'&IV_PART&'_'&INV_IVDATE AS SALES_KEY RESIDENT INV_SALES_TEMP

        • Re: missing/misplaced FROM
          Stefan Wühl

          Yes, can't see any FROM statement.

           

          Could you please post your actually script statement, not the unformatted errror message, which is hard to read anyway.

           

          In addition, what is

           

          נבדק לא פה השגיאה של הדי באגר (IV_IVCOST * (IF (DEBIT='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3 = INV_CURRENCY,FNC_EXCHANGE3, IF(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) / IF(CURREG_EXCHANGE3 > 0 , CURREG_EXCHANGE3 , CUR_EXCHANGE3) AS CURRENCY_TOTPRICE,


          supposed to do?

            • Re: missing/misplaced FROM
              jhonatan ben ami

              just noticed it thanks! now for some reason i am getting this error:

              Error in expression: ')' expected: INV_SALES: LOAD CUST_CUST AS INV_CUST, INV_IVDATE AS IVDATE, INV_INVNUM, CUST_AGENTNAME AS INV_AGENTNAME, IV_AGENT, IV_BRANCH, INV_TYPE, IV_PART, TRANS_COST, IV_QUANT, IV_QUANT*IF(DEBIT ='C',-1,1) AS RIV_QUANT, IV_PERCENT, IV_COMMISSION, IV_IVCOST, (IF(ISNULL(IV_TRANS) =-1,0,IV_TRANS)) AS IV_TRANS, IV_CREDITFLAG, (IF(DEBIT='C',(-1),1)) AS IVCAL_CREDIT, (IV_IVCOST * (IF (DEBIT ='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3 = INV_CURRENCY,FNC_EXCHANGE3, if(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) AS NIS_TOTPRICE, (IV_IVCOST * (IF (DEBIT='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3=INV_CURRENCY,FNC_EXCHANGE3, IF(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) / IF(FNC_EXCHANGE2 > 0 , FNC_EXCHANGE2, IF(CURREG_EXCHANGE2 > 0 , CURREG_EXCHANGE2 , CUR_EXCHANGE2)) AS DOLLAR_TOTPRICE, (IV_IVCOST * (IF (DEBIT='C',(-1),1)) * (IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3 = INV_CURRENCY,FNC_EXCHANGE3, IF(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))) / IF(CURREG_EXCHANGE3 > 0 , CURREG_EXCHANGE3 , CUR_EXCHANGE3) AS CURRENCY_TOTPRICE, IF ((IsNull(TRANS_COST)=0 OR TRANS_COSTFLAG = 'M') OR (IV_TRANS <> 0 AND TRANS_CURDATE <=MAXACC_COSTDATE), TRANS_COST * (IF (TRANS_QUANT * IV_TQUANT < 0.0,(-1),1)), (IV_PART_COST * IV_QUANT / PART_COSTQUANT * (IF (DEBIT='C',(-1),1)) * (IF (IV_CREDITFLAG='Y',0,1)))) AS NIS_COST, IF ((IsNull(TRANS_SECONDCOST)= 0 OR TRANS_COSTFLAG = 'M') OR (IV_TRANS <> 0 AND TRANS_CURDATE <= MAXACC_COSTDATE), TRANS_SECONDCOST * (IF (TRANS_QUANT * IV_TQUANT < 0.0,(-1),1)), PART_SECONDCOST * IV_QUANT / PART_COSTQUANT * (IF (DEBIT ='C',(-1),1)) * (IF (IV_CREDITFLAG = 'Y',0,1))) AS DOLLAR_COST, (IF ((IsNull(TRANS_SECONDCOST)= 0 OR TRANS_COSTFLAG = 'M') OR (IV_TRANS <> 0 AND TRANS_CURDATE <= MAXACC_COSTDATE), TRANS_COST * (IF (TRANS_QUANT * IV_TQUANT < 0.0,(-1),1)), IV_PART_COST * IV_QUANT / PART_COSTQUANT * (IF (DEBIT ='C',(-1),1)) * (IF (IV_CREDITFLAG='Y',0,1))) ) / IF(CURREG_EXCHANGE3 > 0 ,CURREG_EXCHANGE3 , CUR_EXCHANGE3) AS CURRENCY_COST, (IV_DUTYCOST * (IF (DEBIT ='C',(-1),1)) * (IF((=1) AND IV_DUTYCOST <> 0,IV_IEXCHANGE,(IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3=INV_CURRENCY,FNC_EXCHANGE3, if(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))))) AS NIS_DUTYCOST, CUST_CUST&'_'&IV_AGENT&'_'&IV_BRANCH&'_'&IV_PART&'_'&INV_IVDATE AS SALES_KEY RESIDENT INV_SALES_TEMP

                • Re: missing/misplaced FROM
                  jhonatan ben ami

                  i got it for this script:

                  (IV_DUTYCOST * (IF (DEBIT ='C',(-1),1)) * (IF(($(vEXPORTEXCHANGE)=1) AND IV_DUTYCOST <> 0,IV_IEXCHANGE,(IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3=INV_CURRENCY,FNC_EXCHANGE3,

                  if(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE ))))))) AS NIS_DUTYCOST,

                  (IV_DUTYCOST * (IF (DEBIT = 'C',(-1),1)) * (IF(($(vEXPORTEXCHANGE) =1) AND IV_DUTYCOST <> 0,IV_IEXCHANGE,(IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3 = INV_CURRENCY,FNC_EXCHANGE3,

                  if(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE )))))))/ IF(FNC_EXCHANGE2 > 0 , FNC_EXCHANGE2, IF(CURREG_EXCHANGE2 > 0 ,

                  CURREG_EXCHANGE2 , CUR_EXCHANGE2))  As  DOLLAR_DUTYCOST,

                  (IV_DUTYCOST * (IF (DEBIT ='C',(-1),1)) * (IF(($(vEXPORTEXCHANGE)=1) AND IV_DUTYCOST <> 0,IV_IEXCHANGE,(IF(INV_CURRENCY = (-1) ,1,IF(FNC_CURRENCY3=INV_CURRENCY,FNC_EXCHANGE3,

                  if(CURREG_EXCHANGE > 0 , CURREG_EXCHANGE, CUR_EXCHANGE )))))))/  IF(CURREG_EXCHANGE3 > 0 ,CURREG_EXCHANGE3 , CUR_EXCHANGE3) As  CURRENCY_DUTYCOST,