Leading Zeros (1 Viewer)

JEB

Registered User.
Local time
Today, 02:30
Joined
Dec 20, 2002
Messages
16
I am exporting a report from Access into Excel. One field has a store # - say 029. I need to have the leading zero in the field - but I can not get Excel to leave it there.

Any suggestions?

Thanks for the help.

Jeb
 
Last edited:

mhartman

Dr. Data
Local time
Yesterday, 18:30
Joined
Jun 5, 2006
Messages
442
You need to make sure that the column in Excel that this item goes in is formatted as "Text"

Regards
Mark
 

JEB

Registered User.
Local time
Today, 02:30
Joined
Dec 20, 2002
Messages
16
Thanks for the reply.

The problem is that I would like it to export directly from Acess into Excel- without opening an Excel worksheet and formatting the cells.

Is there a way to have Excel recognize numbers as text when being exported?

Thanks,
Jeb
 

boblarson

Smeghead
Local time
Yesterday, 18:30
Joined
Jan 12, 2001
Messages
32,059
Just format your field in your query to export like this:
Num: Format(CStr([Number]),"000")
changing Num to whatever you want your column header to be
and [Number] to whatever your number field name is called.
 

mhartman

Dr. Data
Local time
Yesterday, 18:30
Joined
Jun 5, 2006
Messages
442
Hello:

I tried Bobs solution and could not get it to work when I ran the query and exported it.

YourNewColumn: "000" & [YourNumberField]

in a query does work though

Regards
Mark
 

JEB

Registered User.
Local time
Today, 02:30
Joined
Dec 20, 2002
Messages
16
Didn't work for me. I am trying to export from an Acess REPORT - not just from the query. I don't know if that makes any difference

Thanks,
Jeb
 

Users who are viewing this thread

Top Bottom