converting from oracle to teradata

Database

converting from oracle to teradata

Hi There

I used to work with oracle.Now i am new to teradata below is the custom sql that is in oracle now i need to write this in teradata.

months_between(trunc(sysdate,'mon'),to_date((V_T_A_Pmr.Yearmonth*100+1),'yyyymmdd') ) <=25

Please suggest me how to right in oracle.

Thanks
Harsha.
1 REPLY

Re: converting from oracle to teradata

Try rewriting the logic to something like this. (This may not be very accurate as I am not sure what those oracle functions do, but this should be a good starting point for you if you are stuck !)

ADD_MONTHS( CAST( (TRIM(YM*100+01)) AS DATE FORMAT'YYYYMMDD') , 25 ) <= CURRENT_DATE