Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Converting Number to Character - forum topic by Stiphu

$
0
0

I have a numeric value which I want to divide by 1000:

SELECT DISTINCT
    Speed_Val_Down AS svd,
    CAST(svd AS FLOAT) / 1000 AS div,
    CAST(res AS VARCHAR(50)) AS res
FROM
    SPH
ORDER BY
    1;

The numeric value svd is Decimal(18,0), the Result can be something between 0.011 an 1000. Now my Problem is that the string result is in the scientific format (2.400000000000E 000), but I would like to have the normal format as I have it as a floating number. An example:
The value for swd is 2400, so the result div is 2.4 and the character result is "2.40000000000000E 000", but I would like to have the res to be the same as the div. Any suggestion?
 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>