Results 1 to 10 of 10
  1. #1
    Gambit17 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    26

    Rounding of numbers

    I have an append query that appends records to a new table. But for some reason it is rounding the figures of my numbers and I have no idea why.

    I'm sure there is a really simple explanation but any help would be great.

    Thanks so much

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    To what precision is it rounding? What is the data type of the field in the destination table?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    A couple of things to look for:

    Are you sure it is actually rounding the numbers, or is it just a display (format) issue? Are they rounded if you open the table itself?

    Is the rounding to the nearest integer, i.e. before the decimal point? If so, check the data type of the table field that is giving you the problem - if it is number - integer, that is the problem - it needs to be number - single (or number - double)

    John

  4. #4
    Gambit17 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    26
    Hi yeah I though that but the data type is number. And in the table shows the rounded finger. I cant understand it. Even when I enter in a new number in my form it rounds it for some reason.

    I cant think why it is doing it.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    What is the field size?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Gambit17 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    26
    Long Integer. It goes into a union query first and then an update query moves it to the table. I cant understand it though because if I look in the union query the amounts have decimals. So somewhere in the update or the actual table is rounding the numbers.

  7. #7
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Your problem is the "Long Integer" field size. Integers do not have a decimal portion. If you want to keep the decimal portion, you have to use Single" or "Double" as the field size.

    The query will show the decimals because it is a calculated field. The decimals are lost and the values rounded when the data is appended to the table. Changing the field size to single or double should resolve your problem.

    John

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    I'd also consider Currency, which will avoid the potential floating point issues that Single and Double can have.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Gambit17 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    26
    Sweet thanks so much. That solves that. What floating point issues can arise pbaldy?

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    2+2 might not equal 4. It might be 4.00000001.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Rounding
    By Rhubie in forum Queries
    Replies: 3
    Last Post: 05-30-2013, 10:55 AM
  2. Rounding numbers
    By jlgray0127 in forum Forms
    Replies: 5
    Last Post: 03-02-2012, 12:55 PM
  3. Replies: 1
    Last Post: 11-29-2011, 08:43 AM
  4. rounding down
    By markcranmer in forum Queries
    Replies: 1
    Last Post: 10-11-2011, 09:43 AM
  5. Rounding
    By BLD21 in forum Reports
    Replies: 5
    Last Post: 06-20-2011, 01:06 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