title: Calculate amount on the basis of semiannual
body: <p>I have a question, I want merge my table data through date, all information provide in given table</p>
  
  <p>If Aggregation = Semiannual</p>
  
  <p>My table</p>
  
  <p>Table-1</p>
  
  <pre><code>Amount |   TheDate      | Aggregation
  -------+----------------+-------------    
  100    |  2013-01-01    | Quaterly
  100    |  2013-02-01    | Quaterly
  100    |  2013-03-01    | Quaterly
  100    |  2013-04-01    | Quaterly
  100    |  2013-05-01    | Quaterly
  100    |  2013-06-01    | Quaterly
  200    |  2013-07-01    | Quaterly
  200    |  2013-07-01    | Quaterly
  200    |  2013-09-01    | Quaterly
  200    |  2013-10-01    | Quaterly
  200    |  2013-11-01    | Quaterly
  200    |  2013-12-01    | Quaterly
  </code></pre>
  
  <p>I want result like this</p>
  
  <pre><code>Amount |   Date      | Aggregation
  -------+-------------+-------------    
  600    |  2013-06-01 | Quaterly 
  1200   |  2013-12-01 | Quaterly 
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>SELECT  
      DATEADD(MONTH, 2, DATEADD(quarter, DATEDIFF(quarter, 0, TheDate), 0)) AS Amount,
      ROUND(CONVERT(FLOAT, SUM(Amount)) / 1000, 0) AS Total
  FROM   
      myTble    
  GROUP BY
      DATEADD(quarter, DATEDIFF(QQ, 0, TheDate), 0)
  </code></pre>
  
  <p>I'm trying above query but it only works for quarter</p>