List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:August 22 2008 1:30pm
Subject:RE: Zip Codes with Leading Zeros
View as plain text  
>-----Original Message-----
>From: Keith Spiller [mailto:larentium@stripped]
>Sent: Thursday, August 21, 2008 10:12 PM
>To: mysql@stripped
>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



Thread
Zip Codes with Leading ZerosKeith Spiller22 Aug
  • RE: Zip Codes with Leading ZerosTom [Burlington] Kralidis22 Aug
    • Re: Zip Codes with Leading ZerosKeith Spiller22 Aug
      • Re: Zip Codes with Leading ZerosAndy Shellam22 Aug
        • RE: Zip Codes with Leading ZerosJerry Schwartz22 Aug
      • Re: Zip Codes with Leading ZerosJason Pruim22 Aug
  • RE: Zip Codes with Leading ZerosJerry Schwartz22 Aug
Re: Zip Codes with Leading ZerosKeith Spiller22 Aug
  • Re: Zip Codes with Leading Zeroswalter harms22 Aug