Date And Add_Month query problem

Database
Enthusiast

Date And Add_Month query problem

Hi,

Can anyone help me to convert the below query in Teradata.

SELECT TO_CHAR(SYSDATE-7,'DD-MON-YYYY')||'|'||TO_CHAR(LAST_DAY(ADD_MONTHS(SYSDATE,11)),'DD-MON-YYYY') FROM dual;

I am trying very hard, but as new to teradata, so couldnt workmuch.

Please help me asap

Tags (2)
2 REPLIES
Enthusiast

Re: Date And Add_Month query problem

Hi,

Can you help me to run below query too.

SELECT TO_CHAR(TO_DATE('07-APR-2014'),'YYYYMMDD')||'|'|| TO_CHAR((TO_DATE('07-APR-2014') + 90),'YYYYMMDD')

FROM dwuser.SYSDUMMY1;

Enthusiast

Re: Date And Add_Month query problem

Try below

SEL TO_CHAR((CURRENT_DATE - 7), 'DD-MON-YYYY') || '|' || TO_CHAR(LAST_DAY(ADD_MONTHS(CURRENT_DATE, 11)), 'DD-MON-YYYY') ;

SEL TO_CHAR(TO_DATE('14-APR-2014', 'DD-MON-YYYY'), 'YYYYMMDD') || '|' ||  TO_CHAR(TO_DATE('14-APR-2014', 'DD-MON-YYYY') + 90, 'YYYYMMDD') ;

Thanks

Santanu