All Forums Database
muthu1802 20 posts Joined 01/12
21 Jul 2015
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.
 

muthu1802 20 posts Joined 01/12
21 Jul 2015

Input Values --- OutPut
123.23               123.23
123.00               123   

You must sign in to leave a comment.