You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - Attribute Tables forum

Comparing two text fields…!   Jamal ZETAWI Mar 26, 2010
Re: Comparing two text fields…!   martin maretta Mar 26, 2010
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Comparing two text fields…! 
Author Jamal ZETAWI 
Date Mar 26, 2010 
Message
Comparing two text fields…!

I have two text fields in certain shape file, can I compare the corresponding record values?

I need to know whether these two fileds have the same values in each record

You may ask why I need that? The first column is already existing in the attribute table of the layer, the second column is obtained by applying the “join command”, the join was based in ID (numbers) in the two table but not by the text fields…in this case I need to know whether any modifications has occurred to the text fields the old one that I already have and the other one that I obtained from the join

thank you
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Comparing two text fields…! 
Author martin maretta 
Date Mar 26, 2010 
Message hi you can create temporary field for example of type integer. then use field calculator ..check "Advancet" put this code there :
dim x as integer
if [Field1]= [field2] then
x=1
end if

and on the bottom write x..see the attachment
([Field1]= [field2] is names of your fields)...then only select value = 1 where field1 = field2 
  esri.JPG (opens in new window)