Hi
I attempted to perform a simple mathematical operation (like dividing 10 by
4) in a text box of a Table or body of a report and I end up with an integer
result (10\4 gives me 2.0). I used convert method, CDbl method and I still
get the same result. I formated the text box as N5, C2 and other formats but
still the same result.
The original problem is that the same thing happens with a report parameter
when I try to use it in calculations but by troubleshooting the problem I
realized that it happens in any text box.
What am I doing wrong?
Thanks
ShawnInteresting, I was going to suggest trying 10.0/4.0, but after adding
an expression "=10/4" to a text box I see the result is 2.5. Is you
operation in an expression or in custom code?
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 12 Nov 2004 13:40:08 -0800, "Shawn Kralj"
<ShawnKralj@.discussions.microsoft.com> wrote:
>Hi
>I attempted to perform a simple mathematical operation (like dividing 10 by
>4) in a text box of a Table or body of a report and I end up with an integer
>result (10\4 gives me 2.0). I used convert method, CDbl method and I still
>get the same result. I formated the text box as N5, C2 and other formats but
>still the same result.
>The original problem is that the same thing happens with a report parameter
>when I try to use it in calculations but by troubleshooting the problem I
>realized that it happens in any text box.
>What am I doing wrong?
>Thanks
>Shawn|||>10\4 gives me 2.0
If you are really using \ then you are getting the correct result. The
'backslash' operator returns only the integer portion of the result.
If you're expecting 2.5 as the result, then you have to use / instead.
On Fri, 12 Nov 2004 13:40:08 -0800, "Shawn Kralj"
<ShawnKralj@.discussions.microsoft.com> wrote:
>Hi
>I attempted to perform a simple mathematical operation (like dividing 10 by
>4) in a text box of a Table or body of a report and I end up with an integer
>result (10\4 gives me 2.0). I used convert method, CDbl method and I still
>get the same result. I formated the text box as N5, C2 and other formats but
>still the same result.
>The original problem is that the same thing happens with a report parameter
>when I try to use it in calculations but by troubleshooting the problem I
>realized that it happens in any text box.
>What am I doing wrong?
>Thanks
>Shawn|||Oooh , good catch.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Sun, 14 Nov 2004 23:17:36 -0500, Dan Knight
<dknight@.REMOVEmullinixpackages.THIScom> wrote:
>>10\4 gives me 2.0
>If you are really using \ then you are getting the correct result. The
>'backslash' operator returns only the integer portion of the result.
>If you're expecting 2.5 as the result, then you have to use / instead.
>On Fri, 12 Nov 2004 13:40:08 -0800, "Shawn Kralj"
><ShawnKralj@.discussions.microsoft.com> wrote:
>>Hi
>>I attempted to perform a simple mathematical operation (like dividing 10 by
>>4) in a text box of a Table or body of a report and I end up with an integer
>>result (10\4 gives me 2.0). I used convert method, CDbl method and I still
>>get the same result. I formated the text box as N5, C2 and other formats but
>>still the same result.
>>The original problem is that the same thing happens with a report parameter
>>when I try to use it in calculations but by troubleshooting the problem I
>>realized that it happens in any text box.
>>What am I doing wrong?
>>Thanks
>>Shawn
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment