Archives of the TeradataForum
Message Posted: Thu, 24 Jan 2008 @ 23:11:06 GMT
This has never worked (at least not for me). Teradata is cutting the leading zero so you have to provide a format on which you would like to cast.
Try this one:
CAST ( CAST( ( extract (month from cast(DATE_FIELD as DATE FORMAT 'YYYYMMDD') ) ) AS DECIMAL(2) FORMAT '99')AS CHAR(2)) AS MONTH_ID
It's not elegant but it works :)
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|