Home All Groups Group Topic Archive Search About

Convert real => decimal (3,2)

Author
22 Sep 2005 5:11 PM
Stephan Zaubzer
Folks,
How can I convert a real value to a decimal value? As long as the real
value is not zero I am getting an arithmetic overflow error.
I tried both convert and cast.
Does anyone have an idea?
Cheers
Stephanz

Author
22 Sep 2005 5:35 PM
Akbar khan is a Senior Database develope
HI Thiere

there is no need of type costing ....it is implecit type costing betweer
real and decimal numbers.

_



________________________________________________

Show quote
"Stephan Zaubzer" wrote:

> Folks,
> How can I convert a real value to a decimal value? As long as the real
> value is not zero I am getting an arithmetic overflow error.
> I tried both convert and cast.
> Does anyone have an idea?
> Cheers
> Stephanz
>
Author
22 Sep 2005 8:47 PM
Trey Walpole
Hmm - i can only duplicate if the real has more than 1 digit to the left
of the decimal... (implicit or explicit conversions)
e.g., 1.234 converts fine, but 12.34 does not

Stephan Zaubzer wrote:

Show quote
> Folks,
> How can I convert a real value to a decimal value? As long as the real
> value is not zero I am getting an arithmetic overflow error.
> I tried both convert and cast.
> Does anyone have an idea?
> Cheers
> Stephanz
Author
22 Sep 2005 9:20 PM
Hugo Kornelis
On Thu, 22 Sep 2005 19:11:47 +0200, Stephan Zaubzer wrote:

>Folks,
>How can I convert a real value to a decimal value? As long as the real
>value is not zero I am getting an arithmetic overflow error.
>I tried both convert and cast.
>Does anyone have an idea?

Hi Stephan,

As Trey already indicated: you will get this error for data that is
above 9.99 or below -9.99. In the notation "decimal(3,2)", the first
number (3) is the TOTAL number of positions; the second number (2) is
the number if digits after the decimal point. That leaves only one digit
for the integer part.

If your values range from -999.99 to 999.99, use DECIMAN(5,2) instead.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)

AddThis Social Bookmark Button