>From: Keith Spiller [mailto:larentium@stripped]
>Sent: Thursday, August 21, 2008 10:12 PM
>Subject: Zip Codes with Leading Zeros
>RE: Zip Codes with Leading Zeros
>We need to export a MySQL table with a zip code field to Excel. We
>currently use PhpMyAdmin to export to CSV or Excel files. We have had
>problems with zip codes with leading zeros. The leading zeros are
>removed so that we are left with incomplete codes. Can you help us
>learn the correct procedure for dealing with, exporting and importing
[JS] If the column is defined as text, the leading zeroes should be in the
data that comes out of PHPMyAdmin. Are they there?
I don't know exactly what happens when PHPMyAdmin creates an Excel workbook
directly, I've never tried it, but I suspect it designates all columns as
"general" format. That will interpret zip code (and other things that look
like numbers, such as unpunctuated phone numbers) as numeric data,
clobbering the leading zeroes.
I suggest that you export the data as a CSV file; then import it into Excel.
That will give you the opportunity to force the zip code field to be
interpreted as text.
We don't use CSV files, but we do use tab-delimited files in this fashion.
Works fine, lasts a long time.
>Thank you very much for all your help.