Hello, I'm trying to execute intck statement on a teradata table: case when intck('day', close_date ,today() ) le 80 then 'Y' else 'N' end as Closed but it gives me the error: ERROR: Teradata prepare: Syntax error: expected something between '(' and the string 'day'. I then found that intck is not supported on teradata. Today() gives a num type, and close_date variable is num type with date9. format. so when I try to run this: case when ('today()' - 'close_date')le 80 then 'Y' else 'N' end as Closed, it obviously gives me this error: ERROR: Teradata prepare: A character string failed conversion to a numeric value. which is understandable and I know I need to convert close_date into num too. But I'm not sure syntax wise how to do that conversion on a teradata table and then use it to assign the value to the 'Closed' flag. Appreciate the help! This is the code: proc sql;
connect to teradata (user="%sysget(USER)" password="&dbpass." tdpid=rchtera mode=teradata);
drop table uwork.pop;
create table uwork.pop (FASTLOAD=YES) as select * from connection to teradata
( select top 10
a.accno,
b.close_date
/*,case when intck('day',b.close_date,today() ) le 80 then 'Y' else 'N' end as Closed*/
,case when ('today()' - 'b.close_date')le 80 then 'Y' else 'N' end as Closed
from table1 a left join table2 b on a.accno=b.accno
);
DISCONNECT FROM TERADATA;
quit;
... View more