Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 22 Nov 2006 @ 20:55:05 GMT


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


Subj:   Rounding for Decimal
 
From:   Mogilevsky, Boris

Hi all,

I am having a following problem.

After performing calculations like

     (abs( (0.464)* (coalesce(T1.Policy_Age_s,0))/(SUM1+3.0731) ) )
          as Reason_Cd1

     ,(abs( (0.235)* (coalesce(T1.Avg_Prop_Dmg_Covg_Prem_s,0))/(SUM1+3.0731)) )
          as Reason_Cd2

the results are being inserted into a table. Both Reason_Cd1 and reason_Cd2 are declared as DECIMAL(18,15) in that table.

T1.Policy_Age_s, T1.Avg_Prop_Dmg_Covg_Prem_s and SUM1 are declared as DECIMAL(18,10). What is happening is that Reason_Cd2 is being rounded to a closest integer which is 0 in that case. Apparently the real result is exceeding precision of DECIMAL(18,15). Can anybody advise me how to avoid this problem ?


Thanks,

Boris Mogilevsky
TERADATA Professional Services



     
  <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