Select to view content in your preferred language

Calculate field tool is assigning the FIRST VALUE to all the records!!!

823
2
06-17-2012 09:16 PM
AshakaThakore
Emerging Contributor
I am trying to calculate field
i m using vb type of expression

in the codeblock i have written this code
Dim getCVAL
If (Diameter>10) Then
  getCVAL="1234"
else
  getCVAL="4567"
End if

in the expression, i have written getCVAL

Calculate field tool is assigning the FIRST VALUE to all the records!!!

now what is wrong with this code,
please help thanks
0 Kudos
2 Replies
MarcinGasior
Frequent Contributor
If "Diameter" is a field containing values, it should be in [] brackets:
Dim getCVAL
If [Diameter] > 10 Then
  getCVAL = "1234"
Else
  getCVAL = "4567"
End If
0 Kudos
AshakaThakore
Emerging Contributor
yes its a field... thanks a lot
0 Kudos