 |
 |
Archives of the TeradataForum
Message Posted: Tue, 17 Jan 2012 @ 23:10:00 GMT
Subj: | | Re: How to CAST a number without getting a decimal point. |
|
From: | | Dieter Noeth |
BOB DUELL wrote:
| How can I avoid the trailing decimal point in the result of casting a numeric result to character? In other words, this query: | |
> select cast( acct_id*-1 as char(29)) as new_acct_id
> from my_table
> where acct_id = 123775780
| Results in a string "-123775780." (without the quotes of course). I want the result returned without the trailing decimal point. | |
| I'm using SQL Assistant and the column data type is DECIMAL(15,0) if that matters. | |
select -acct_id (format '-(15)9') (char(16))
Dieter
| |