|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Convert real => decimal (3,2)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 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 > 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 On Thu, 22 Sep 2005 19:11:47 +0200, Stephan Zaubzer wrote:
>Folks, Hi Stephan,>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? 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) |
|||||||||||||||||||||||