title: Crystal Reports Formula for Dynamic Field Names
body: <p>I have tried figuring this out but to no avail. The database I am working in has fields that show the balance of GL Account based on period (e.g. <code>{GLAF.BAL1}</code>, <code>{GLAF.BAL2}</code>, <code>{GLAF.BAL3}</code> etc).
  I am looking for a way to show the SUM of the balances based on the current date. </p>
  
  <p>I have the following formula to determine what the current period is (our fiscal year starts 8/1:</p>
  
  <pre><code>if month(currentdate) &gt;= 8 then Period := (Month(currentdate)-7) else Period := (Month(currentdate)+5)
  </code></pre>
  
  <p>Is there a way that I can create a formula that would basically do the following. Two examples to make sure it is clear:</p>
  
  <p>Example 1 (current period = 4):</p>
  
  <pre><code>Balance =: ({GLAF.BAL1} + {GLAF.BAL2} + {GLAF.BAL3})
  </code></pre>
  
  <p>Example 2 (Current Period = 7):</p>
  
  <pre><code>Balance =: ({GLAF.BAL1} + {GLAF.BAL2} + {GLAF.BAL3} + {GLAF.BAL4} + {GLAF.BAL5} + {GLAF.BAL6})
  </code></pre>