title: SQL query to find users for monthly anniversary
body: <p>I'm attempting to write a query that find users who are celebrating a monthly anniversary with my company so we can trigger an email to them (i.e., if today's date is 3/27, it would find people who signed up on 1/27, 2/27, 3/27, 4/27, etc., regardless of year). </p>
  
  <p>My method is to find users whose "day" part of their sign-up date equals the "day" part of today's date. </p>
  
  <pre><code>SELECT [User Id],[Sign Up Date] 
    FROM [Monthly Account Update] 
   WHERE DATEPART(DAY,[Sign Up Date]) = DAY(GETDATE())
  </code></pre>
  
  <p>However, this of course doesn't work for these scenarios:</p>
  
  <ol>
  <li><p>At the end of February, I wouldn't get the chance to email people with 29, 30 and 31 monthly anniversary days, as the don't happen. Ideally, when it's February 28th, I'd just like to lump in people with 29, 30 and 31 dates.</p></li>
  <li><p>For every other month where the date ends in a 30th, I wouldn't get to email people with 31st dates. Ideally here, I'd just like to lump in people with 30 and 31 dates.</p></li>
  </ol>
  
  <p>Can either of those things be accomplished with a SQL query?</p>