sdmay

Using if then statements in field calculator to condense / merge fields

Discussion created by sdmay on Oct 18, 2011
Latest reply on Oct 18, 2011 by dhoneycutt-esristaff
I'm new to using the field calculator, and also new to writing code. I'm trying to use VB Script in the calculator to essentially merge the information in four separate fields into one large field. I started out just by adding them all together in order separated by spaces. This worked however many of the rows are blank which is creating field values of numerous spaces, so I want to try to incorporate an if then statement for each field that will be merged so that if a field is blank for one record it won't be transferred into the new field. I've found and used coding examples in the archived forums and copy/pasted them with the values I though should work but nothing seems to be working. I keep getting syntax errors. Also is it even possible to have four to five if then statements in one field calculator statement? Please help relieve my frustration.

Outcomes