Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 17 Dec 2001 @ 20:11:11 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Need help on sql syntax to convert values from decimal to characters
 
From:   Marcus Diaz

As for the case when the source is 0, you could use a case statement, something like:

select
CASE WHEN ID=0 '0'
ELSE trim(leading ('0') from ID(format'9(18)')(char(255))) END

I'm not sure about negative numbers, although whatever you find to solve that problem, you could add another condition in your CASE statement for numbers less than 0.



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023