+ Reply to Thread
Results 1 to 5 of 5

Correcting Decimal Error when Exporting from Access to Excel

  1. #1
    Registered User
    Join Date
    01-22-2009
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    30

    Correcting Decimal Error when Exporting from Access to Excel

    When I export from MS access to Excel using a macro, all the numbers are getting decimal errors like

    0.109 => 0.108999997377396
    1.253 => 1.25300002098083

    The numbers are having long unnecessary decimals.

    I already have excel spreadsheet, with all these columns of long decimals. How to correct them?

    1) Is there a worksheet function which corrects this decimal errors?
    2) Is there a way to correct the macro to correct in while exporting it?

    Thanks.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by cricrazy; 01-28-2009 at 08:48 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Correcting Decimal Error when Exporting from Access to Excel

    Hello cricrazy,

    It isn't an error. You simply need to set the number format for the Excel column to display only decimal places.

    1.Select the Column
    2. Right Click in column and select Format Cells...
    3. Click the Tab labled Number
    4. In the Category box click Number
    5.Change the Decimal Places to 3
    6. Click OK
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-22-2009
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Correcting Decimal Error when Exporting from Access to Excel

    Quote Originally Posted by Leith Ross View Post
    Hello cricrazy,

    It isn't an error. You simply need to set the number format for the Excel column to display only decimal places.

    1.Select the Column
    2. Right Click in column and select Format Cells...
    3. Click the Tab labled Number
    4. In the Category box click Number
    5.Change the Decimal Places to 3
    6. Click OK

    I agree. But it only changes the way it changes the way excel displays the number. The number's decimal precision error remains the same.
    I would like to correct that.
    I hope I convey my point. Thanks for the reply.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Correcting Decimal Error when Exporting from Access to Excel

    Hello cricrazy,

    Internally all Excel decimal fractions are computed to 15 places. So, where's the error?

  5. #5
    Registered User
    Join Date
    01-22-2009
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Correcting Decimal Error when Exporting from Access to Excel

    I have added the excel sheet. You can have a look at it. You can see the depth column and avg dia column. They don't have error but I suppose its precision floating point number error.

    Thanks.
    Chris.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1