Converting Timestamp to Date - Translation from Oracle Syntax

Database
Fan

Converting Timestamp to Date - Translation from Oracle Syntax

Hi Guys,

I need assistance in translating this sql syntax from Oracle to Teradata.
AUTHORIZED_DATE column is a TIMESTAMP

select distinct a11.AUTHORIZED_DATE AUTHORIZED_DATE,
trunc(nvl(a11.AUTHORIZED_DATE,TO_DATE('31-DEC-4712','DD-MON-YYYY'))) CustCol_15
from O2_PO_REQUISITION_D a11

Thanks for your help.

WALM
1 REPLY
Senior Apprentice

Re: Converting Timestamp to Date - Translation from Oracle Syntax

trunc -> cast as date
nvl -> coalesce

coalesce(cast(a11.AUTHORIZED_DATE as date), DATE '4712-12-31')

Dieter