Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Access to Excel Number precision (2003)

    I have a table in Access that has a numeric field (Single) and specs of 3 decimal places. When exported to Excel via the following line, the Excel column with the number contains 14 decimal places.
    DoCmd.TransferSpreadsheet acExport, 8, strSheetName, strFullPath, True

    Why would this happen? I have attached a spreadsheet comparing the two results.

    Thanks,

    Ken
    Attached Files Attached Files

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

    Re: Access to Excel Number precision (2003)

    The Single data type has a precision of 7 significant digits.
    Excel uses the Double data type for storing numbers and performing calculations. When you convert a Single precision number to Double, you'll see small rounding errors beyond those 7 significant digits.
    This is a completely natural effect.
    You can format the cells in Excel with a Fixed or Scientific format to limit the number of decimal places that is displayed.
    Or use Double precision in Access too.

  3. #3
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Access to Excel Number precision (2003)

    Hans,

    Will changing to double in Access still allow limiting the decimal places to three?

    Thanks,

    Ken

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

    Re: Access to Excel Number precision (2003)

    Yes, the three decimal places are a display format only, they have nothing to do with the way the numbers are stored.

Posting Permissions

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