title: How to get rows with a date is less than 30 days in SQL Server?
body: <p>I have the following table structure:</p>
  
  <p>Table: <code>tbl_CustomerPromos</code>:</p>
  
  <pre><code>COLUMN       DATATYPE
  PromoCodeID  int (IDENTITY)
  CustomerID   int
  PromoCode    nvarchar(50)
  AddedDate    DateTime
  IsPromoUsed  smallint
  </code></pre>
  
  <p>I want to send email notification to all customers <strong>AFTER EVERY 7 days from the DAY of JOINING (<code>AddedDate</code>) until the next 30 days.</strong></p>
  
  <pre><code>select 
     pc.[CustomerID]
     , pc.[PromoCode]
     , pc.[DiscountAmount]
     , ISNULL(pc.[IsPromoUsed], 0) IsPromoUsed
     , pc.[AddedBy]
     , pc.[AddedDate]
     , (c.FirstName + ' ' + c.LastName) FullName
     , c.Email
  from 
     tbl_PromoCodesNewCustomer pc
  Left join 
     tbl_Customers c on pc.CustomerID = c.CustomerID
  Where 
     isnull(pc.IsPromoUsed, 0) &lt;&gt; 1
     AND pc.AddedDate = ?
  </code></pre>
  
  <p><strong>NOTE:</strong> The 30days is to be counted from the day of joining (<code>AddedDate</code>) to next 30 days and not from joining month.</p>
  
  <p>So, how to get rows with a date that is less than 30 days (<code>AddedDate</code> is not greater than 30 days from today's date)</p>