Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Apr 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Decimal & Rounding (Access 2000)

    I am having a problem with the way Access stores decimal fields and exporting the fields. I am dealing with dollar fields and doing percent calculations on the fields. When I do the calculation and display it the number rounds correctly. Example stored 444.775 displays as 444.78. The problem is exporting. I need it to export number as the rounded amount (444.78) not the stored amount. Currently the fields are Number, Double, Fixed, 2 decimals. I can not use data type = currency because when you export the '$' sign is included.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Decimal & Rounding (Access 2000)

    I assume you are using a query. If so, you can put the format in the field itself instead of in the Format property:

    Format([Something], "0.00")

    Note that this will convert the value to text.

  3. #3
    New Lounger
    Join Date
    Apr 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Decimal & Rounding (Access 2000)

    I just tried it. Example: "191688.18475 rounds to 191688.20". I would of expected it to round to "191688.19". Does this make sense? I did the same thing on the report and it comes out '191688.18'.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Decimal & Rounding (Access 2000)

    In fact, I would think it should be rounded to 191688.18. Rounding to 2 decimals is done in one step. After the second decimal (8) there is a 4. Since this is less then 5, you round down.
    (You don't do it this way: .18475 -> .1848 -> .185 -> .19)

    I tried this, and exported both to Excel and to text. In both cases, the exported value was 191688.18. So I don't understand why you get .20
    What are you exporting to, actually?

  5. #5
    New Lounger
    Join Date
    Apr 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Decimal & Rounding (Access 2000)

    I got it to work finally by formatting as '#0.00'. I was exporting the query as a .txt which would then go into our accounting package. Thanks for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •