Microsoft KB Archive/135116

{| = PRB: Zip-Code Format Changed If Imported from Microsoft Excel =
 * width="100%"|

ID: Q135116

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a

SYMPTOMS
When importing a Microsoft Excel spreadsheet into FoxPro, you may see differences in the formatting of certain numbers. One example of this is when bringing over zip codes. A zip code may have a leading zero (0) in Microsoft Excel. The same zip code when imported into FoxPro will have a leading space. This is by design.

RESOLUTION
You can easily change this behavior. After the import is complete, if you see leading spaces where you want leading zeros. For example, assuming the field is named Zip and has a width of five, type the following command to update the table to show leading zeros instead of spaces:

REPLACE ALL Zip WITH STRTRAN(Zip," ","0")

STATUS
This behavior is by design.

Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60 2.60a KBCategory: kbinterop kbprb KBSubcategory: FxinteropExcel
 * }