Results 1 to 5 of 5
  1. #1
    wcrimi is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    142

    Rounding Decimals in Table Field


    I have a query that does some calculations and stores the results in a table field defined as Fixed with 2 decimal positions.

    When I display the table field it shows 2 decimal positions, but if I look at how the data is actually stored or export it to Excel it's stored with as many decimal positions as were in the result.

    So if the result was 99.1191111 it shows me 99.12, but if I export it it exports 99.1191111 to Excel.

    Is there any way to change the data in that table to actually store it as 2 decimal positions rounded?

  2. #2
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,002
    The decimal places is actually only really a display format, not how the number is stored.

    If you adjust your queries to round the answer to only two decimal places that will fix the problem.

    More info here https://www.uvm.edu/~bnelson/compute...malplaces.html
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,776
    Hmm, the general opinion is that you don't store calculations, except maybe in rare cases. I wonder if this is one of those cases.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    wcrimi is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    142
    Quote Originally Posted by Micron View Post
    Hmm, the general opinion is that you don't store calculations, except maybe in rare cases. I wonder if this is one of those cases.
    That's probably good advice in general, but in this case I needed it stored in the table. I found a way around it in Excel which is where the data ended up in this case anyway. So I'm good to go!

    Thanks

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,776
    in this case I needed it stored in the table.
    That is seldom really true, but you might have an exception. The thinking is that forms and reports should do calculations on the fly in case any inputs change. In case you want to follow up on the theory
    http://allenbrowne.com/casu-14.html
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 3
    Last Post: 07-06-2015, 07:28 AM
  2. Format field to show 2 decimals
    By takara in forum Forms
    Replies: 13
    Last Post: 06-04-2015, 03:18 PM
  3. How to hide decimals in the form field
    By azhar2006 in forum Forms
    Replies: 20
    Last Post: 01-25-2014, 01:40 PM
  4. Rounding decimals
    By brianmcleer in forum Access
    Replies: 1
    Last Post: 06-05-2013, 12:37 PM
  5. Stop text box from rounding decimals
    By Deutz in forum Access
    Replies: 1
    Last Post: 02-17-2011, 07:32 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