<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Sum and Grouping in Linq</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Sum and Grouping in Linq</description>
  <pubDate>Fri, 10 Apr 2026 22:33:38 -700</pubDate>
  <lastBuildDate>Wed, 08 Jan 2014 16:28:17 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=4632</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Sum and Grouping in Linq : Hi Bill,Try:varquery=mgr.DuesOweds ...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4632&amp;PID=17319#17319</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 4632<br /><strong>Posted:</strong> 08-Jan-2014 at 4:28pm<br /><br />Hi Bill,<div><br></div><div>Try:</div><div><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial initial; -repeat: initial initial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">var</span>&nbsp;query&nbsp;=&nbsp;mgr.DuesOweds        .Where(<span style=": rgb251, 251, 253; font-size: 12px; line-height: 16.799999237060547px;">d&nbsp;=&gt;&nbsp;d.SocSecNo&nbsp;==&nbsp;member.SocSecNo&nbsp;&amp;&amp;&nbsp;d.DuesCatCd.StartsWith(</span><span style="font-size: 12px; line-height: 16.799999237060547px; color: rgb163, 21, 21;">"D"</span><span style=": rgb251, 251, 253; font-size: 12px; line-height: 16.799999237060547px;">)</span><span style="line-height: 1.4;">)</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.GroupBy(d&nbsp;=&gt;&nbsp;d.<span style=": rgb251, 251, 253; font-size: 12px; line-height: 16.799999237060547px;">DuesYearMonth</span><span style="line-height: 1.4;">)</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Select(d&nbsp;=&gt;&nbsp;<span style="color:blue;">new</span>&nbsp;{&nbsp;duesYearMonth&nbsp;=&nbsp;d.Key,&nbsp;duesRate&nbsp;=&nbsp;d.Sum(d1&nbsp;=&gt;&nbsp;d1.DuesAmount)&nbsp;})&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Where(d&nbsp;=&gt;&nbsp;d.duesRate != 0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.OrderByDescending(d&nbsp;=&gt;&nbsp;d.duesYearMonth);</pre></div><div><br></div><div><br></div>]]>
   </description>
   <pubDate>Wed, 08 Jan 2014 16:28:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4632&amp;PID=17319#17319</guid>
  </item> 
  <item>
   <title>Sum and Grouping in Linq : How would i do the following in...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4632&amp;PID=17315#17315</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 4632<br /><strong>Posted:</strong> 29-Dec-2013 at 10:26am<br /><br />How would i do the following in Linq. Here is the SQL<br><br>Select duesyearmontn, sum(duesamount) as duesrate<br>from duesowed<br>where socsecno = "999-99-9999' and duescatcd = 'D'<br>group by duesyearmonth<br>having sum(duesamount) &lt;&gt; 0<br>order by duesyearmonth desc<br><br><br><br>this is what i have so far<br><br><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">var</span>&nbsp;duesOwedQuery&nbsp;=&nbsp;_manager.DuesOweds&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Where(d&nbsp;=&gt;&nbsp;d.SocSecNo&nbsp;==&nbsp;member.SocSecNo&nbsp;&amp;&amp;&nbsp;d.DuesCatCd.StartsWith(<span style="color:#a31515;">"D"</span>))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.OrderByDescending(d&nbsp;=&gt;&nbsp;d.DuesYearMonth); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">var</span>&nbsp;duesOweds1&nbsp;=&nbsp;duesOwedQuery.Execute&lt;<span style="color:#2b91af;">DuesOwed</span>&gt;();<br>how do i handle the group by and having clause?<br><br>Bill<br><br></pre><br><br><br><br>]]>
   </description>
   <pubDate>Sun, 29 Dec 2013 10:26:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4632&amp;PID=17315#17315</guid>
  </item> 
 </channel>
</rss>