<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'How to operate SUMAND AVERAGE operation in datagridview?' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'How to operate SUMAND AVERAGE operation in datagridview?' posted on the 'Visual Basic' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 07:02:04 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 07:02:04 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>How to operate SUMAND AVERAGE operation in datagridview?</title>
      <link>http://www.programmersheaven.com/mb/VBasic/426844/426844/how-to-operate-sumand-average-operation-in-datagridview/</link>
      <description>hi! Can someone help me with my proposed study. I have a column in a datagrid to be sum up but I dunno knoe how to perform the sum operation  in datagrid and average at the same time.. :))&lt;br /&gt;
--&lt;br /&gt;
I have a field column (Course Code,Unit,Grade,Remarks) I just use a query for the Unit.. I need to add the units having a grade of 5.00 or 4.00 then divide it with the total units of subject enrolled.. I've tried to use a query in access but when I connect it to vb6 the error is type mismatch :)) I dunno if my code is correct&lt;br /&gt;
&lt;br /&gt;
My code is like this:&lt;br /&gt;
&lt;br /&gt;
Private Sub cmdcompute_Click()&lt;br /&gt;
Dim sumtotal As String&lt;br /&gt;
Dim sumfail As String&lt;br /&gt;
Dim avg As Integer&lt;br /&gt;
&lt;br /&gt;
sumfail = "SELECT Sum(Curriculum_entries.Unit)" &amp;amp; _&lt;br /&gt;
"FROM Student_pros INNER JOIN Curriculum_entries ON Curriculum_entries.Course_code=Student_pros.Course
_code" &amp;amp; _&lt;br /&gt;
"WHERE Curriculum_entries.Unit='" &amp;amp; dtpros.Columns(5).Text &amp;amp; "' AND Grade &amp;gt;= 4.00"&lt;br /&gt;
&lt;br /&gt;
sumtotal = "SELECT Sum(Curriculum_entries.Unit)" &amp;amp; _&lt;br /&gt;
"FROM Student_pros INNER JOIN Curriculum_entries ON Curriculum_entries.Course_code=Student_pros.Course
_code" &amp;amp; _&lt;br /&gt;
"WHERE Curriculum_entries.Unit='" &amp;amp; dtpros.Columns(5).Text &amp;amp; "' AND Student_pros.Grade &amp;gt;= 4.00" &amp;amp; Me.dtpros.Columns(6).Text &amp;amp; "'"&lt;br /&gt;
&lt;br /&gt;
avg = (sumfail / sumtotal) * 100&lt;br /&gt;
&lt;br /&gt;
If avg &amp;lt;= 24 Then&lt;br /&gt;
txtstatus.Text = "Regular"&lt;br /&gt;
Exit Sub&lt;br /&gt;
ElseIf 25 &amp;gt;= avg &amp;lt;= 49 Then&lt;br /&gt;
txtstatus.Text = "Warning"&lt;br /&gt;
Exit Sub&lt;br /&gt;
ElseIf 50 &amp;gt;= avg &amp;lt;= 74 Then&lt;br /&gt;
txtstatus.Text = "Probation"&lt;br /&gt;
Exit Sub&lt;br /&gt;
ElseIf avg &amp;gt;= 75 Then&lt;br /&gt;
txtstatus.Text = "Dismissal"&lt;br /&gt;
End If&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/426844/426844/how-to-operate-sumand-average-operation-in-datagridview/</guid>
      <pubDate>Mon, 16 Jan 2012 05:45:38 -0700</pubDate>
      <category>Visual Basic</category>
    </item>
  </channel>
</rss>
