|
|
Archives of the TeradataForum
Message Posted: Tue, 03 Aug 2005 @ 02:28:36 GMT
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.
| |