title: CASE or IF in AND statement
body: <p>I've got a query with a bunch of AND statements. Now when a variable is set, I want to use a specific AND statement. But when it's empty or NULL I don't want that statement. I've found some things with IF and CASE but I can't get it done :(</p>
  
  <p>I Want something like this</p>
  
  <pre><code>SELECT *
  FROM table
  WHERE [Statement1]
  
  IF @Location IS NOT NULL OR &lt;&gt; ''
  BEGIN
      AND [SBC Live 2$Sales Shipment Line].[Location _ Sector No_] = @Location
  END
  </code></pre>
  
  <p>Maybe someone can help me?</p>
  
  <p>Thnanks in advance!</p>