Archives of the TeradataForum
Message Posted: Tue, 17 Jan 2012 @ 23:09:20 GMT
Numeric to Numeric Conversion
SELECT CAST (50500.75 AS INTEGER); Result: 50500 (truncated), SELECT CAST (50500.75 AS DEC (6,0)); Result: 50501. (rounded).
When you cast from a decimal to an integer, the system discards everything to the right of the decimal point. In our example, even though the decimal portion was .75, making the number closer to 50501 than to 50500, the result of the cast is still 50500.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|