468,456 Members | 1,734 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,456 developers. It's quick & easy.

Round

Hello,

I have a table with marks (from Exams) and when I create a query a
calculated field with an expression like:

Round([mark1]+ [mark2])/2

I am confronted with the problem that Access has a strange outcome.

For instance:

(4+5)/2 returns 4
(5+6)/2 returns 6

Who can help me solving this problem? Thanks
Sep 15 '08 #1
3 1664
Arie wrote:
>I have a table with marks (from Exams) and when I create a query a
calculated field with an expression like:

Round([mark1]+ [mark2])/2

I am confronted with the problem that Access has a strange outcome.

For instance:

(4+5)/2 returns 4
(5+6)/2 returns 6

But, that's what Round() does. It's cakked Bankers Rounding
because it minimizes the rounding errors when adding a
column of values.

What result do you expect, 5 and 6, like we were taught in
grade school? If so, then try using the expression:
Int((mark1+ mark2) / 2 + .5)

--
Marsh
Sep 15 '08 #2
On Sep 15, 6:17*pm, Marshall Barton <marshbar...@wowway.comwrote:
Arie wrote:
I have a table with marks (from Exams) and when I create a query a
calculated field with an expression like:
Round([mark1]+ [mark2])/2
I am confronted with the problem that Access has a strange outcome.
For instance:
(4+5)/2 returns 4
(5+6)/2 returns 6

But, that's what Round() does. *It's cakked Bankers Rounding
because it minimizes the rounding errors when adding a
column of values.

What result do you expect, 5 and 6, like we were taught in
grade school? *If so, then try using the expression:
* * * * Int((mark1+ mark2) / 2 + .5)

--
Marsh
Hi Marsh, she is getting a round up in one case and a round down in
the other?

Bonnie
http://www.dataplus-svc.com
Sep 16 '08 #3
bhicks11 wrote:
>On Sep 15, 6:17*pm, Marshall Barton <marshbar...@wowway.comwrote:
>Arie wrote:
>I have a table with marks (from Exams) and when I create a query a
calculated field with an expression like:
>Round([mark1]+ [mark2])/2
>I am confronted with the problem that Access has a strange outcome.
>For instance:
>(4+5)/2 returns 4
(5+6)/2 returns 6

But, that's what Round() does. *It's cakked Bankers Rounding
because it minimizes the rounding errors when adding a
column of values.

What result do you expect, 5 and 6, like we were taught in
grade school? *If so, then try using the expression:
* * * * Int((mark1+ mark2) / 2 + .5)

Hi Marsh, she is getting a round up in one case and a round down in
the other?

As I said before, that's what Bankers Rounding does.
Specifically, it rounds to the nearest even number in the
next (to the left) position. E.g. 4.5 rounds to 4, 5.5
rounds to 6, 6.5 round to 6, 7.5 rounds to 8, etc. Then, if
you sum a column of those rounded values, the total will be
more accurate than always rounding the midpoint fraction up.

--
Marsh
Sep 16 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Matias Silva | last post: by
17 posts views Thread by nomenklatura | last post: by
9 posts views Thread by Ronald W. Roberts | last post: by
4 posts views Thread by Fuzzydave | last post: by
10 posts views Thread by David Coleman | last post: by
7 posts views Thread by kkmigas | last post: by
3 posts views Thread by Krishna.K.1900 | last post: by
4 posts views Thread by =?Utf-8?B?UmVuZQ==?= | last post: by
9 posts views Thread by josh logan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.