Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 06 Apr 2012 @ 15:32:53 GMT


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


Subj:   Re: Substr from right on decimal number
 
From:   De Pons, Paul

Couple alternatives

     SELECT 198.02345
              ,  SUBSTR(TRIM(198.02345 MOD 1) ,2) AS col1
              , 198.02345 (INTEGER) AS  col2
               , col2 || '-' || col1

     SELECT TRIM(198.02345) AS nbr
           ,  SUBSTR(nbr ,1,POSITION( '.' IN nbr)-1) AS col1
           , SUBSTR(nbr, POSITION('.' IN nbr)+1)  AS  col2
           , col1 || '-' || col2


     
  <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