title: MS SQL Operand type clash: date is incompatible with bigint
body: <p>I'm trying to solve a question on HackerRank using the Tabibitosan method that I read about. Here is a link to the question if you want to read it:
  <a href="https://www.hackerrank.com/challenges/projects/problem" rel="nofollow noreferrer">https://www.hackerrank.com/challenges/projects/problem</a></p>
  
  <p>Here is my error:
  Line 1 Operand type clash: date is incompatible with bigint</p>
  
  <p>Here is my code:</p>
  
  <pre><code>SELECT MIN(start_date), MAX(end_date)
  FROM (
      SELECT
          start_date, end_date,
          dense_rank() OVER (ORDER BY start_date) AS rn,
          start_date - dense_rank() OVER (ORDER BY start_date) AS grouping
      FROM projects
  ) AS r
  GROUP BY grouping
  ORDER BY COUNT(*) ASC, MIN(start_date) ASC;
  </code></pre>
  
  <p>There may be other issues with my code but you don't need to fix those since I'm still learning and figuring things out but I can't solve this error and searching has not helped. </p>
  
  <p>Table:</p>
  
  <pre><code>Task_ID, Int
  Start_date, date
  End_date, date
  </code></pre>
  
  <p>Date format: 2015-10-31</p>
  
  <p>I'm not sure why the code isn't working since the goal is basically the same as the date section of where I found the Tabibitosan Method:
  <a href="https://community.oracle.com/docs/DOC-915680" rel="nofollow noreferrer">https://community.oracle.com/docs/DOC-915680</a></p>