title: Teradata Error 42000
body: <p>I am getting following error while executing sql command through ODBC.</p>
  
  <p>Details: "ODBC: ERROR [42000] [Teradata][ODBC Teradata Driver][Teradata Database] Syntax error, expected something like an 'UDFCALLNAME' keyword between '.' and the 'SUM' keyword. "</p>
  
  <p>The code i am running is following.</p>
  
  <p><code> SELECT t1.BALANCE_DATE, t1.SUM(LCY_BALANCE) AS TOTAL_DEP, t2.SUM(LCY_BALANCE) AS TOTAL_CASH
  FROM
  (SELECT LCY_BALANCE, BALANCE_DATE FROM MY_BALANCE_TABLE
  WHERE LINE_NUMBER BETWEEN '2300' AND '3311' AND BALANCE_DATE BETWEEN '2015-07-01' AND 2016-06-30' AND BRANCH_CODE = '5520'
  GROUP BY BALANCE_DATE) t1
  LEFT JOIN
  (SELECT LCY_BALANCE, BALANCE_DATE FROM MY_BALANCE_TABLE
  WHERE LINE_NUMBER IN ('0040','0050','0060','0105','0110','0115') AND BALANCE_DATE BETWEEN '2015-07-01' AND 2016-06-30' AND BRANCH_CODE = '5520'
  GROUP BY BALANCE_DATE) t2
  ON
  t1.BALANCE_DATE = t2.BALANCE_DATE </code></p>
  
  <p>What could be the error, please guide.</p>
  
  <p>Regards</p>
  
  <p>KAM</p>