title: Calculating number of con-consecutive total years donated in SQL
body: <p>I have some sample donation history: </p>
  
  <p>ID  TransactionDate Amount<br>
  10  2001-12-19 00:00:00.000 75.00<br>
  10  2001-07-11 00:00:00.000 760.00<br>
  10  2010-10-15 00:00:00.000 2200.00<br>
  10  2012-08-15 00:00:00.000 1220.00<br>
  10  2013-09-16 00:00:00.000 610.00<br>
  100 2000-09-26 00:00:00.000 3000.00<br>
  100 1999-01-01 00:00:00.000 5000.00  </p>
  
  <p>I am trying to get a summary of giving by year by donor. The total does not have to be for consecutive years, but will just total overall # of years given. The total does not need to equal the number of transactions per year, just that the ID donated in that particular year. </p>
  
  <p>For instance, ID 10 above would equal 4 indicating giving in 4 calendar years (2 donations in 2001, 1 in 2010, 1 in 2012, and 1 in 2013). ID 100 would equal 2. </p>
  
  <p>The donations date back many years, so hard-coding dates is not very feasible. </p>
  
  <p>Any ideas are appreciated. </p>