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

B

Barb

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
 
J

John Nurick

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
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top