locked
Import a CSV to Access RRS feed

  • Question

  • User1997074450 posted

    I need to import CSV to Access. 

    My first field is an ID with leading zeros.

    It drops the leading zeros?

    Thursday, March 4, 2021 8:05 PM

Answers

  • User-821857111 posted

    You need to make sure that the target column's data type is text if you want to retain the leading zeros. Although I wouldn't recommend doing that. What useful function do the leading zeros performance from an application logic point of view? If they are only used for display, then develop a function for including them whenever you display an ID.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 4, 2021 9:08 PM

All replies

  • User-821857111 posted

    You need to make sure that the target column's data type is text if you want to retain the leading zeros. Although I wouldn't recommend doing that. What useful function do the leading zeros performance from an application logic point of view? If they are only used for display, then develop a function for including them whenever you display an ID.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 4, 2021 9:08 PM
  • User1997074450 posted

    Yes,  you are right have leading zero's in ID field is questionable. I think there are other Id's in the system but with my current knowledge of the system I am restricted to that particular ID with leading zero as that is unique field that can be used to compare records.

    Per your suggestion, I pre-created the  table with id as a text field and its working.

    Thanks :)

    Friday, March 5, 2021 12:33 AM