title: Is it possible to reference a variable via string manipulation?
body: <p>I have a series of datetime variables that need to be referenced, and the key to which variable needs referencing is reached by using substring on another field.  I can create the name of the variable as a string using string manipulation, something like this:</p>
  
  <pre><code>'@' + SUBSTRING(field, CHARINDEX(',', field) + 2, LEN(field) - CHARINDEX(',', field) + 1) + 'start'
  </code></pre>
  
  <p>Is there a way to get SQL to recognize that this is the name of one of my variables?  Some kind of function to convert the string?</p>