I have two "A" fields and "B" and I want to use the field calculator in the "C" field to determine if they are equal
put 1 if they are equal and 0 if they not
A | B | C |
3 | 3 | 1 |
5 | 7 | 0 |
I found this scrip
but it only works in python window
fc = R 'c: \ path \ to \ your \ fc'
with arcpy.da.UpdateCursor (fc, ["FIELD1", "FIELD2", "FIELD3"]) as cursor:
for row in cursor:
if row  == row :
row  = 1
row  = 0
"I want to use the field calculator"
or as a tool for modelbuidel where "fc = R'c: \ path \ to \ your \ fc ' can be a Shapefile imput
Of course both meant to point out that you would replace their field names with yours...in the case of python you need to remember that field names are enclosed in ! marks whereas in VBscript they are surrounded by square brackets. Also, in python, the equality check is == whereas in VBscript a single = will suffice.