import excel file into access and keep leading zeros for data 052

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to import an excel spreadsheet into access. We have columns that
have leading zeros (0521) when I import the file it drops my leading zeros.
Is there a way to keep the zeros when I import the file?

Thanks,

Barb
 
Hi Barb,

If the data in Excel is numeric, it has leading zeroes because someone
formatted it that way. You can get the same result in Access by setting
the format property of the field or textbox to something like
0000

But in general if something has leading zeroes it's not a number
(numbers are things you may do arithmetic on) but a string of digits. In
Access these should go into a text field. You can make sure this happens
by prefixing the numbers in Excel with apostrophes. FOr example,
'0521
will be imported into a text field as the four characters
0521
..
 
Back
Top