Results 1 to 3 of 3
  1. #1
    tanyalee123 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2013
    Posts
    51

    Question Won't Import my Numbers Correctly

    Good morning!


    I have a simple Excel spreadsheet with 2 columns - 1st is a number, 2nd is Text. I need to update an existing table with this new info. The plan is to create a table with my Excel data and then do a query to update the existing table.

    So, the problem is that in the excel spreadsheet there are hundreds of number that are 3 and 4 digits - these are medical codes and for our purposes they need to be 5 digits. So I formatted the column using CUSTOM formatting and added 1 or 2 zeros to the beginning of the numbers. That worked fine. However, when I try to import it (I used copy and paste; that seemed the simplest way to do it) it deletes the zero/s that I put there. When creating my table in Access to import the data, I set field to Text and field size to 5, however, I believe doing that simply tells the table that 5 is the maximum, but doesn't indicate it "must" be 5. (By the way, I tried setting the field to Number, and that didn't work).

    Does anyone know how I can get Access to read these zeros....or another way that I can get this accomplished (like something I can do after the import to get the zeros in front)? Thank you!

    Tanya

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If you applied a Custom Format in Excel, the values are still really numbers, and the leading zeroes really are not there. It is just formatted to show it looking like that (to see what is really in an Excel cell, simply click on the cell and look in the formula bar).

    As such, when importing them into Access, you will not see the leading zeroes because they aren't really there. You could import them as numbers, and apply the same Custom Format in Access as you do in Excel to show leading zeroes (but once again, they aren't really there).

    If you want to make them text values with leading zeroes, use the Text function, i.e.
    =TEXT(A1,"00000")
    Then import that column.

  3. #3
    tanyalee123 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2013
    Posts
    51
    Thank you very much! This worked perfectly!

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

Similar Threads

  1. Replies: 16
    Last Post: 08-15-2014, 12:03 PM
  2. Replies: 15
    Last Post: 12-10-2012, 06:37 PM
  3. Replies: 5
    Last Post: 10-31-2012, 03:41 PM
  4. Import Errors - Fields with Numbers and Letters
    By Eekers in forum Import/Export Data
    Replies: 5
    Last Post: 01-10-2012, 02:52 PM
  5. Replies: 1
    Last Post: 11-29-2011, 08:43 AM

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