Decimal Formatting in Teradata

Database

Decimal Formatting in Teradata

Requirement :




Input (Decimal) Output
123.23 123.23
123.00 123

I want the out as above for the specified Input.

I have tried with FORMAT'Z(20)9' but I am able to remove . (DOT) for the decimal data type. 

sel CAST(CAST(123.23 AS CHAR(20)) AS DECIMAL(18,0) FORMAT'Z(20)9') as Amt

sel CAST(CAST(123.00 AS CHAR(20)) AS DECIMAL(18,0) FORMAT'Z(20)9') as Amt

getting 123 for both Queries.

Please help me with the SQL.

1 REPLY

Re: Decimal Formatting in Teradata

Input Values --- OutPut

123.23               123.23

123.00               123