title: SQL Server - Case Statement
body: <p>I'm almost certain you cannot do this within the context of the case statement, and I haven't been able to find any documentation about it, but is it possible to do the following:</p>
  
  <pre><code>SELECT CASE WHEN testValue &gt; 2 
  THEN testValue(Without Repeating it) ELSE FailValue)
  END 
  FROM Table 
  </code></pre>
  
  <p>A better more thorough example:</p>
  
  <pre><code>Select CASE WHEN (Foo-stuff+bar) &gt; 2 
  THEN Conditional statement without &gt;2 Else "Fail"
  END 
  FROM TABLE
  </code></pre>
  
  <p>I am looking for a way to create a select without repeating the conditional query.</p>
  
  <p>EDIT: Due to a poor example on my part, and the lack of answers I was looking for:</p>
  
  <pre><code>testValue = (Table.A / Table.B) * Table.C Table.D
  
  SELECT CASE WHEN testValue &gt; 2 
  THEN testValue ELSE FailValue)
  END 
  FROM Table 
  </code></pre>