title: Linq query using Group by and Joins
body: <p>I have two tables:</p>
  
  <p><strong>Banner</strong></p>
  
  <pre><code>--------------------------------------------------------|
   BId   | Name | Link | Image | AltText| Target | BActive|
  --------------------------------------------------------
   |1    | hello| http| a.jpg  |helloimg|        |    1   |
  --------------------------------------------------------
  </code></pre>
  
  <p><strong>Tracking</strong></p>
  
  <pre><code>------------------------------------------------------
  |TId   | BId| ICount| CCount| CreateDate             | 
  ------------------------------------------------------
  |1     |  1 | 102   |  300  |  2015-11-17 00:00:000  |
  |2     |  1 | 182   |  100  |  2015-11-14 00:00:000  |
  |3     |  1 | 192   |  200  |  2015-11-12 00:00:000  |
  ------------------------------------------------------
  </code></pre>
  
  <p>I want to find the Sum of ICount and CCound for each BId between 2015-11-12 and  2015-11-15.</p>
  
  <p>Here is the code I have tried:</p>
  
  <pre><code>from p in Bannertables
  join q in BannerTrackings
  on p.BannerId equals q.BannerId
  group p by p.BannerId into myTab
  select new { 
      BannerId = myTab.Key,
      ImpressionCount = myTab.Sum( x=&gt; x.ImpressionCount),
      ClickCount = myTab.Sum(x =&gt; x.ClickCount)
  };
  </code></pre>
  
  <p>How do I sort the result according to the date range I specified?</p>