title: Get last 30 day records from today date in SQL Server
body: <p>I have small question about SQL Server: how to get last 30 days information from this table </p>
  
  <p>Sample data:</p>
  
  <p><code>Product</code>:</p>
  
  <pre><code>Pdate
  ----------
  2014-11-20
  2014-12-12
  2014-11-10
  2014-12-13
  2014-10-12
  2014-11-15
  2014-11-14
  2014-11-16
  2015-01-18
  </code></pre>
  
  <p>Based on this table data i want output like below</p>
  
  <pre><code>pdate
  -------
  2014-11-20
  2014-12-12
  2014-12-13
  2014-11-16
  </code></pre>
  
  <p>I tried this query </p>
  
  <pre><code>SELECT * 
  FROM product 
  WHERE pdate &gt;= DATEADD(day, -30, getdate()).
  </code></pre>
  
  <p>but it now give exactly result. Please tell me how to solve this issue in SQL Server</p>