I have two date columns , i have to find the date difference between sysdate and call_date the difference should be in months. i have to find the difference if it is more than 4 months i have to use the difference in where clause.
i have tried like
sel cast((date-call_dt as interval month(2)) as promt from table name where prompt > 4
is there any function in teradata sql assistant by which this can be done.
Re: findinf date difference of two dates in months
Something like that ?
select (extract(year from current_date) - extract(year from CALL_DATE)) * 12 + (extract(month from current_date) - extract(month from CALL_DATE)) + (case when extract(day from CALL_DATE) < extract(day from current_date) then 0 else -1 end) as MONTHS from MY_TABLE where MONTHS > 4