Results 1 to 5 of 5
  1. #1
    Alex Motilal is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2008
    Location
    Coimbatore, India
    Posts
    192

    Rounding off

    Hi,
    I have created a Raw Cotton Purchase database. Raw cotton is purchased directly from regulated markets in India from farmers @ rates per quintal. In the purchase statement the total quintals and rate is shown and the value is shown in Rounded off Rupees. The syntax used in the underlying query is =Round([quantity]*[rate],0).
    If the result is 150,100.48, it should display as 150,100 and if the result is 150,100.50, it should display 150,001.
    My problem is if the result is 150,100.51, it displays 150,101. However, if the result is 150,100.50 it is not rounding to the higher value and displays the result as 150,100 instead of 150,101. This error is not in Excel.
    Can anyone can help me in identifying what mistake I am making.
    Thanks in advance.

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    if the result is 150,100.50, it should display 150,001 ????

    well that isn't math

    "My problem is if the result is 150,100.51, it displays 150,101".....yes that is the correct rounding !!!

    Access is going to give you a mathematically correct rounding....so it isn't Access' fault here.....you are going to need to implement a custom algorithm....it is not reasonable for you to expect any software to do anything other than correct math in its embedded functionality....

  3. #3
    Alex Motilal is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2008
    Location
    Coimbatore, India
    Posts
    192

    Rounding off

    Thank you very much.
    Access is correct in rounding off 150,000.51 to 150,001/-. However you have not explained why it is not rounding off 150,000.50 to 150,001/-. In Excel it is not so.
    I'll be very happy if you could explain this difference of mathematical calculations in Access and Excel.
    Thanks again for the response.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Unlike Excel, the Access Round() function uses "Banker's rounding". I would recommend creating your own function as I do.

  5. #5
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    well - - I think your question is more about the field definition at the table level...if it is defined as an Integer - it will round. If defined as currency it will be 2 decimal points...you can define it in several ways so it will not round at all...setting the number of decimal places that you want. This is the same as excel - - so the reason I think you see a difference is because the field property is defined differently.

    Also - in Access - one has the ability to define the property at the form level (unlike excel) so therefore if your table field property is correct - double check the form level property as this is display only and does not affect what goes into the table....

    hope this helps...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Rounding the Average in a Query
    By jakelufkin in forum Access
    Replies: 3
    Last Post: 06-19-2009, 08:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums