>-----Original Message-----
>From: Keith Spiller [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 21, 2008 10:12 PM
>To: mysql@lists.mysql.com
>Subject: Zip Codes with Leading Zeros
>
>Hi,
>
>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
>zip codes?
>
[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.
>
>Keith




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to