Forum Discussion
JLuebbert
8 years agoRegular Visitor
Teradata Import Query Error
I am able to run the query below in Teradata without any errors SELECT
YEAR(DATE_FIELD) AS DATE_YEAR
,A.FIELD_1
,A.FIELD_2
,B.FIELD_3
,SUM(AMT_1) AS SUM_AMT_1
,SUM(AMT_2) AS SUM_AMT_2
FROM TABLE...
- Anonymous8 years ago
Can you try SELECT EXTRACT(YEAR FROM DATE_FIELD)?
JLuebbert
8 years agoRegular Visitor
Thanks, that worked! Is there a reference or guide somewhere that outlines which functions do and do not work as with YEAR()? Because SUM() worked without any issue and I could not find any resources that said what I should use instead of YEAR().
Anonymous
8 years agoNot applicable
I tried select year(from date_field) but I got the same error message. Perhaps your teradata client somehow translates it into extract(year from date_field)?