title: Issue with DateCreated
body: <p>I have a table <code>dbo.participation</code>:</p>
  
  <pre><code>ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY CLUSTERED,  
  User VARCHAR(MAX) NOT NULL,  
  ParticipationLevel TINYINT NOT NULL,  
  Selector VARCHAR(MAX) NOT NULL,  
  DateCreated DATETIME NOT NULL
  </code></pre>
  
  <p>I created the code below but unfortunately it shows bad performance for <code>@DateStart</code> and <code>@DateStop</code> </p>
  
  <pre><code>SELECT 
      dateadd(month, datediff(month, 0, DateCreated), 0) AS MDate
      ,COUNT(CASE WHEN ParticipationLevel &gt;= 10 THEN Selector ELSE NULL END) AS ParticipationLevel1
      ,COUNT(CASE WHEN ParticipationLevel &gt;= 30 THEN Selector ELSE NULL END) AS ParticipationLevel2
  FROM 
      Participation
  WHERE 
      (@DateStart IS NULL OR (@DateStart IS NOT NULL 
                              AND DateCreated &gt;= @DateStart)) 
      AND (@DateEnd IS NULL OR (@DateEnd IS NOT NULL 
                                AND DateCreate &lt; @DateEnd))
  GROUP BY 
      Dateadd(month, datediff(month, 0, DateCreate), 0)
  </code></pre>
  
  <p>Do you happen to have any ideas how to improve my code or alternatively how to modify the table to improve performance?</p>