Leading zeros deleted when exporting report to Excel

hobbes

Registered User.
Local time
Today, 14:43
Joined
Feb 13, 2004
Messages
30
Hi,

In my database, I have a function that allows users to pull reports and export them to Excel. All of the information shows up perfectly on the database report, but as soon as I export it to Excel some of the information gets lost, specifically the zeros that lead an account number. Not every account number has these zeros and the account numbers vary in length, so there's no easy way to tell which records were affected during the export. Is there a way to keep Excel from deleting these zeros when I export the report? I have tried formatting the database to death, but I must be missing something. I don't have a template in Excel for the reports to go into because they vary (there are several different types of reports the user can pull). Any help would be great!
Thanks!
 
Try adding a ' before the numbers, excel will view the number to be tekst....

Regards
 
namliam said:
Try adding a ' before the numbers, excel will view the number to be tekst....

Regards

Thanks for your replay Namliam....How would I update all of these fields? My table has 50,000+ records and I add thousands daily. I have no idea how many accounts begin with zero.
 
I am allmost sure your using a query to export...

well in the query, FixedAccount: "'" & [AccountNumber]

Regards
 
namliam said:
I am allmost sure your using a query to export...

well in the query, FixedAccount: "'" & [AccountNumber]

Regards

I am exporting directly from a report and all of the information in the report is correct (the preceding zeros are there). I tried putting your code in my query that the report is linked to and it pulled no records. I put it in the criteria portion of the selected field and changed the name you have in the code to match my field name. Am I putting it in the wrong place?

Thanks!!!
 
Dont put it in the criteria but in the values (top most row of the query builder)

Regards
 
Could you possible format the column in Excel as TEXT so that it doesnt automatically truncate and delete the leading zeros?
 

Users who are viewing this thread

Back
Top Bottom