title: SQL Server: compare dates by only matching month and day
body: <p>I have a stored procedure that fetches records based on dates matching a date input which works fine so far. 
  Both the dates in the table and my input date are formatted as datetime. </p>
  
  <p>Instead of comparing the full dates I would like to change this so that it only compares month and day so that it works with any year for the input. </p>
  
  <p><strong>Example:</strong> 
  A date in the table is saved as <code>2013-04-30</code> and my input date is <code>2014-04-30</code>. 
  What I want is that the stored procedure still returns that record independent of the year as long as month and day match. </p>
  
  <p><strong>My stored procedure:</strong> </p>
  
  <pre><code>ALTER PROCEDURE [dbo].[FetchDays]
      @inputDate datetime
  AS
  BEGIN
      SET NOCOUNT ON;
      SELECT      dateID,
                  dayDT,
                  countries,
                  regions
      FROM        DaysDT
      WHERE       dayDT = @inputDate
      FOR XML PATH('daysFixed'), ELEMENTS, TYPE, ROOT('root')
  
  END
  </code></pre>
  
  <p>Many thanks for any help with this, Mike. </p>