Note: The content in this article pertains to ArcGIS versions 8.x and 9.x only. Later versions of ArcGIS may contain different functionality, as well as different names and locations for menus, commands and geoprocessing tools.
Zip codes are exclusively numbers, and are often stored in a numeric (formatted) field. When a zip code with leading zeros is entered in a numeric field, the leading zeros are omitted, therefore creating an incorrect zip code. ArcMap tries to match the data type with the appropriate field types for imported tables, often causing zip codes to be designated to a numeric field.
ArcGIS attribute tables store values in several different data types, generally they are numeric, text or date.
Numeric fields can contain only numbers and can be used in calculations. Text fields can contain any combination of numbers and letters, but cannot participate in numeric calculations.
Zip codes produce a unique problem, in the sense that they are all numbers, can begin with zeros, and will not participate in calculations.
Storing zip codes in a text field eliminates this problem. However, if the data is received with the zip codes in a numeric field, then this data will need to be migrated to a text field to correct it. The field itself cannot be changed, as there is no way to change the data type of a field in ArcGIS.
Instructions provided describe how to migrate the truncated numeric data to a text field to restore the leading zeros.
Note: [Zip_Code_Text_Field] refers to the name of the new text field containing the zip code information in brackets.
Code: Length = 4
VB Script: “0” + [Zip_Code_Text_Field] Python: “0” + !Zip_Code_Text_Field!
Get help from ArcGIS experts
Download the Esri Support App