Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 03 Aug 2005 @ 02:28:36 GMT


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


Subj:   Re: Cast to Decimal - Error 2679
 
From:   Geoffrey Rommel

  Does anyone know why the following SQL fails (or does it work on your system?):  


          > sel cast (cast ('-.000219999696128070354' as varchar(60)) as decimal(18,4));

  What's weird is that if you take off that last digit (4), then it works.  


I believe the parser is converting the character string to a floating-point field. Doubles have a precision of 52 bits (between 16 and 17 decimal digits), so it thinks that anything with more than 17 digits is an error.



     
  <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