title: How to select data from sql that is older than 6 months?
body: <p>I want to select some data from one table if a date from another table is at least 6 months before today.
  I tried going off of something like this:
  <a href="https://stackoverflow.com/questions/7740849/select-records-from-sql-server-if-greater-than-6-months">Select records from SQL Server if greater than 6 months</a>
  but I get the error: <em>Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &lt;, &lt;= , >, >= or when the subquery is used as an expression.</em><br/> Here is my way of approching this:</p>
  
  <pre><code>SELECT FCIF, [Date], [Desc]
  FROM tblFCIF
  WHERE tblFCIF.FCIF =
  (SELECT FCIFSignOff.FCIF
  FROM FCIFSignOff
  WHERE ID='12'
  AND (DateDiff(month,SignOffDate,GetDate()) &gt; 0) )
  </code></pre>
  
  <p>So this code withouth the last line selects everything with the ID, 12.  I just need to get everything that is from  6+ months ago.</p>
  
  <pre><code>DATEDIFF(datepart,startdate,enddate)
  </code></pre>
  
  <p>when 'month' is in daypart it returns the difference in months.</p>