424,962 Members | 1,998 Online 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
3 Replies

 P: n/a Arie wrote: >I have a table with marks (from Exams) and when I create a query acalculated field with an expression like:Round([mark1]+ [mark2])/2I 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

 P: n/a bhicks11 wrote: >On Sep 15, 6:17*pm, Marshall Barton Arie wrote: >I have a table with marks (from Exams) and when I create a query acalculated 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 Roundingbecause it minimizes the rounding errors when adding acolumn of values.What result do you expect, 5 and 6, like we were taught ingrade 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 inthe 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 