Select to view content in your preferred language

Field Calculator Error - 000539

372
1
04-25-2011 12:28 PM
AldenAckerman1
New Contributor
Hey there,
Trying to using information from one field to process data for the next and continually get the
'000539 error'

Here is what I am typing:

IF [Condition] = 'Seasonal' THEN [Canopy] = '20'

and I am pretty sure that should be fine (I have put == instead of = and it still doesn't work - I have taken off the quotation marks for my canopy but it still does not work)

If you have any advice - please shoot! Any advice is appreciated.

-Alden
0 Kudos
1 Reply
DarrenWiens2
MVP Alum
You have (at least) a couple of ways to do this, but you can't do if-then code unless you use the code block.

1.) Make a selection to get only the rows where [Condition] = "Seasonal". Then, use the Field Calculator, which only looks at the selected rows, to make [Canopy] = "20" (if [Canopy] is a number field, leave off the quotes).
2.) Paste this into the Field Calculator code block, when calculating the field [Canopy]:
if [Condition] = "Seasonal" then
result = "20"
else
result = null
end if

and type the word result into the main Field Calculator text box.

You should probably look at this page for more help.
0 Kudos