title: Using multiple NOT IN Statements with SQL
body: <p>I have a statement in a stored Proc that filters out certain records with a NOT IN statement before it runs an error check.</p>
  
  <pre><code>WHERE Column1 NOT IN (X,Y)
  </code></pre>
  
  <p>Recently a new variable was introduced that I need to filter out before one of the error check statements. What I wanted to write was. </p>
  
  <pre><code>WHERE Column1 NOT IN (X,Y) OR Column2 NOT IN (UD,CD)
  </code></pre>
  
  <p>This will not work though because I cannot make the second NOT IN recognize the WHERE. The <code>UD,CD</code> Keep pulling as columns instead of values within the columns. Just for information there are 7 possible values that could be in this column. and none of the nesting I have tried works right for this scenario. What am I missing? Should I approach this entirely different?</p>
  
  <p>_______________________Edit_________________________________________________
  Both the post from @Bjones from @briangerhards essentially solved my problem. Once I went back and looked at how the table was created I noticed that single quotes would be needed for an IN statement. In addition to this the post from @Briangerhards prompted me to look at my existing filters and I realized that the second NOT IN statement needed to be included with the first AND statement for the filter to work correctly due to the relation of the data. If I had seen the latter first on my own I may have never had posted because I had originally tried single quotes. When the filter failed I assumed they(the '') were at fault and not my structure. I suppose this should be a lesson to not panic. lol Thank you again everybody for al your assistance.</p>