title: Case When Condition in Where Clause
body: <p>I am building one of the reports in SSRS where parameter values can be either NULL or it can contain NON-NULL value.</p>
  
  <p>Now if the value selected by user is NULL (from dropdownlist) then the SQL Query would be </p>
  
  <pre><code>field-Name IS NULL
  </code></pre>
  
  <p>If the value selected by user is anything except NULL, the SQL Query would be </p>
  
  <pre><code>field-Name IN (@parameter-values)
  </code></pre>
  
  <p>I need to put this condition in WHERE Clause using Case-When so that whatever input is given by user, it is handled by the SQL Query and appropriate result is returned. It could be possible that user selects both NULL and Non-NULL values from dropdownlist.</p>
  
  <p>Please guide as to how to put the "case" condition in where clause OR if any other solutions exists</p>
  
  <p><strong>Update</strong>:</p>
  
  <pre><code>WHERE @IR_Project_Type = 
      (
          CASE WHEN ([IR Project Type] = NULL) THEN ([IR Project Type] IS NULL)
          END 
      )
  </code></pre>
  
  <p>// The 'IS NULL' condition throws an error.</p>