By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,998 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

Round

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.