A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Rounding



 
 
Thread Tools Display Modes
  #1  
Old July 22nd, 2004, 06:58 PM
DB
external usenet poster
 
Posts: n/a
Default Rounding

I originally posted this under "General Discussions", but
I think it might belong here instead so sorry for the
duplicate if you noticed it under "General Discussions".

Hi, I'm using the "round" function in a query like this:
Round([Field_Name],0). My problem is that when a number
has a decimal of exactly .5 it gets rounded down and I
would like it to be rounded up. For example, when 10.5 is
returned it gets rounded to 10. I would like it to be
rounded to 11. Is it possible to have a decimal of .5 be
rounded up instead of down? Thanks.
  #2  
Old July 22nd, 2004, 09:22 PM
Ted Allen
external usenet poster
 
Posts: n/a
Default Rounding

Hi,

Actually, Access uses bankers rounding meaning it will
always round numbers ending in .5 to the nearest even
number. So, 10.5 should round to 10 while 11.5 should
round to 12. This is to minimize the cumulative affect
of the rounding.

I believe that the most common workaround to always round
up is to add 0.5 to the original number and then use the
int() function to return the resulting integer.

HTH, Ted Allen
-----Original Message-----
I originally posted this under "General Discussions",

but
I think it might belong here instead so sorry for the
duplicate if you noticed it under "General

Discussions".

Hi, I'm using the "round" function in a query like this:
Round([Field_Name],0). My problem is that when a number
has a decimal of exactly .5 it gets rounded down and I
would like it to be rounded up. For example, when 10.5

is
returned it gets rounded to 10. I would like it to be
rounded to 11. Is it possible to have a decimal of .5

be
rounded up instead of down? Thanks.
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rounding a Number Up or Down-Depending on Situation Dave Y Worksheet Functions 6 June 18th, 2004 04:39 PM
average rounding to 3 decimal places Bernie Deitrick Worksheet Functions 0 June 2nd, 2004 06:11 PM
Rounding Error Peo Sjoblom Worksheet Functions 3 April 19th, 2004 01:59 PM
No Rounding - need full decimal value JE McGimpsey Worksheet Functions 2 March 10th, 2004 10:55 PM
rounding Carla Worksheet Functions 1 February 4th, 2004 03:08 PM


All times are GMT +1. The time now is 08:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.