Warning: The procedure below is for ArcGIS 10.0 or later versions. Python scripts are not a supported expression type in earlier versions.
Instructions provided demonstrate how to use the Field Calculator to compare two fields on the same row of data. Fields that are different will be flagged with 0. Fields that are the same will be flagged with a 1.
Create a new field. Set the type as short or long integer and accept the other defaults.
A. If editing, stop the current edit session. B. Open the feature class attribute table. C. Click the Table Options button. D. Select 'Add Field' to open the Add Field dialog box. E. Name the new field. F. Select 'Long Integer' from the 'Type' drop-down list. G. Accept the default values for all Field Properties. H. Click OK.
Right-click the newly created field in the step above and click "Field Calculator."
Select the Python parser.
Ensure that the 'Show Codeblock' option is checked.
Paste the following code into the Pre-Logic Script Code box: .