1

I have a question about executing the year() function in TeraData from SAS. For example, when executing the code below, I will get the error message below the codes. Is there a way to execute the year() function besides using the year function in SAS after the table is created from TeraData?

 select * from connection to teradata (
      select customer_id
           , year(date)
      from base.customers a
  );


ERROR: Teradata execute: Syntax error: expected something between ',' and the 'year' keyword
JNevill
  • 46,980
  • 4
  • 38
  • 63
Bob
  • 121
  • 1
  • 4
  • 12

1 Answers1

4

You are getting an error because there is no YEAR function in Teradata. Instead you can use Extract():

 select * from connection to teradata (
      select customer_id
           , EXTRACT(YEAR FROM date)
      from base.customers a
  );
JNevill
  • 46,980
  • 4
  • 38
  • 63