Exporting Leading Zeros

thingssocomplex

Registered User.
Local time
Today, 23:51
Joined
Feb 9, 2009
Messages
178
Hi All,

Apologies if not in the correct area, but I am hoping someone can help.

When exporting data to CSV leading zeros are omitted is there any code I can write in SQL that will not allow the leading zeros to be omitted? I've heard you can use "01234" double quotes but this dose not work does anyone else have any suggestions?

I don't want users to have to do this work outside of excel using notepad etc...

You help is gratefully appreciated
 
Hi I am viewing the CSV in excel
 
I've read on the net the "PAD" command can be used to force leading zeros to stay with double quoatation marks
 
Open the .csv in notepad to check the data properly, maybe excel is stripping out the zeros.

If this isn't the case then convert the column you are outputting to text
 
Use a template excel file and format the column to text
 

Users who are viewing this thread

Back
Top Bottom