Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 14 Sep 2004 @ 12:28:31 GMT


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


Subj:   Interesting Calculations If U spend time !
 
From:   Kambhoji, Naveen Ram Prasanna

One Calculation different Results, What is this magic of Teradata?

Teradata

     SELECT 6*393.2600*1.57000*(10/60.00) Res

      Result : 629.76656400000


     SELECT 6*393.2600*1.57000*(CAST(10 AS DECIMAL(18,6))/60.00) Res

      Result : 617.419434836400000


     SELECT 6*393.2600*1.57000*(CAST(10 AS FLOAT)/60.00) Res

      Result : 617.418200000

Note : None of these give the results as given by the SQL Server. If any one gets the result as returned by any other databases please do let me know!!!

SQL Server

     SELECT 6*393.2600*1.57000*(10/60.00)

      Result : 617.415730327200000


     SELECT 6*393.2600*1.57000*((CAST(10 AS FLOAT))/60.00)

     Result : 617.41819999999996


     Calculator Result : 617.4182

Can anyone explain why we get an error when I do CAST with more than 6 decimal points for the above calculation?

     SELECT 6*393.2600*1.57000*(CAST(10 AS DECIMAL(18,7))/60.00) Res - Gives an error

We had an existing SQL server system and we are migrating it to Teradata, we face an issue of 0.01 to 0.03 for each records and we have thousands/millions of records when we SUM these things imagine the difference?


regards,

Prasanna.
Team Telephia.



     
  <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: 27 Dec 2016