title: SQL DateDiff without enddate
body: <p>I'm using SQL Server
  I need to know the number of days that a patient was receiving a treatment.
  The problem is that I can only get a startDate but not an endDate
  When I run a query and order it by StartDate I get something like this:</p>
  
  <pre><code>StartDate
  2012-10-11 22:00:00.000
  2012-10-11 23:10:31.000
  2012-10-12 00:28:31.000
  2012-10-12 01:39:01.000
  2012-10-12 02:09:01.000
  2012-10-12 03:39:01.000
  2012-10-12 04:38:50.000
  2012-10-20 06:00:00.000
  2012-10-20 08:06:05.000
  2012-10-20 10:21:55.000
  2012-10-21 14:13:01.000
  2012-10-21 15:13:01.000
  </code></pre>
  
  <p>The answer I should get is 4 days (Days 11, 12, 20 and 21)
  The treatment stopped on 2012-10-12 and a new treatment started on 2012-10-20
  How can I sum up the days the patient was getting the treatment despite not having an endDate?</p>
  
  <p>Thank you,</p>
  
  <p>Loperam</p>