 |
 |
Archives of the TeradataForum
Message Posted: Tue, 18 Jan 2012 @ 01:16:43 GMT
Subj: | | Re: How to CAST a number without getting a decimal point. |
|
From: | | DUELL, BOB |
This one works as well, but sorry Deiter, yours padded the result with blanks at the beginning (although using the negative sign rather than
multiplying by -1 was a nice catch. To summarize the 3 replies:
select cast (cast(acct_id*-1 as bigint ) as char(29)) as Glenn
, -acct_id (format '-(15)9') (char(29)) as Deiter
, cast (cast(acct_id*-1 as format '-(15)9' ) as char(29)) as Fred
from (
select cast(123775780 as DECIMAL(15,0)) as acct_id
) xxx
And the explanation from Mahesh was useful and enlightening.
Thanks all!
| |