title: SQL - ignore where clause if null / no input
body: <p>I'm building a SSRS report and would like one of my parameters to be optional where data is entered or not. </p>
  
  <p>Here is an example query for a better understanding:</p>
  
  <pre><code>SELECT
   C1
  ,C2
  ,C3
  FROM
   db_Database..tb_Table
  WHERE
   tb_Table_DateTime between [THEN] and [NOW]
   AND
   tb_Table_Integer IN (@Integer)
  </code></pre>
  
  <p>I'm trying to work out if, in my query, I can ignore the whole:</p>
  
  <pre><code>AND tb_Table_Integer IN (@Integer)
  </code></pre>
  
  <p>line if user chooses not to input any number.</p>
  
  <p>Bascially, I want all data returned unless specified otherwise via @integer.</p>
  
  <p>If not possible in the query, can this be achieved in the Visual Studio?</p>
  
  <p>Cheers.</p>