Performing field calculations is an easy way to batch update many records at once in your table. The Field Calculator works on string, number, and date fields and automatically calculates selected records if the layer or table has a selection set present.
There are several tips for working with the field calculator which include the following:
- You can make calculations without being in an editing session; however, in that case, there is no way to undo the results.
- If you are working with the attribute table of a geodatabase feature class that participates in a geodatabase topology, geometric network, or a relationship class, the Field Calculator command is unavailable when you are not in an edit session.
- Use double quotes when calculating strings.
- When calculating a date field, any Python or VBScript datetime function can be used. Optionally, a number sign (#) canbe used to denote a date in the same way that double quotationmarks (") are used to denote a string. The numbersign is not locale aware and can only work properly with U.S.English date structures. For other locales, use DateSerial() oranother locale-specific function.
- A warning message will appear when performing a calculation on a text field if truncation occurs because the field length is too small to hold the calculated values. Truncated values are flagged with an asterisk so you can easily find and fix them if necessary.