Hi,
I am using CAST and TRYCAST on a VARCHAR field and casting it into TIMESTAMP WITH TIME ZONE. Both funtions are producing differnent time zones.
SELECT Type(COL) AS DATATYPE ,CAST(COL AS TIMESTAMP) AS WITHCAST_WO_TZ ,TRYCAST(COL AS TIMESTAMP) AS WITHTRYCAST_WO_TZ ,CAST(COL AS TIMESTAMP WITH TIME ZONE) AS WITHCAST_W_TZ ,TRYCAST(COL AS TIMESTAMP WITH TIME ZONE) AS WITHTRYCAST_W_TZ FROM DB.TBL WHERE ID=123123123 order by start_date;
Below is result
Teradata time zone is
Has anyone faced something similar?
I would suggest you report this to Teradata support as a bug.
It looks like CAST correctly identifies that a Daylight Saving adjustment is in effect for your current session, but would not have been in effect on 16 Aug 2017; while TRYCAST seems to use the current session time zone as-is.