Sql Joins on multiple table returning product of two columns
<p>I am trying to generate a report on a sql server database in asp.net and I am getting the results of some columns as a product of two columns. Here is the code</p>

<pre><code>   comm.CommandText = "SELECT Count(Courses.CourseID) AS CourseCount, Count(Students.StudentID) AS StudentCount, Schools.Name, Schools.StartDate, Schools.SchoolFees " +
                "FROM Schools" +
                "LEFT JOIN Courses ON (Schools.SchoolID = Courses.SchoolID)" +
                "LEFT JOIN Students ON (Schools.SchoolID = Students.SchoolID) " +
                "WHERE Schools.Active = 1 " +
                "GROUP BY Schools.Name, Schools.StartDate, Schools.SchoolFees";
</code></pre>

<p>When I run the code, the result displays, but the columns for "CourseCount" and "StudentCount" display a value that is a product of each individual column. "CourseCount" is normally 288 and "StudentCount" is 38 but when I run the code, both "CourseCount" and "StudentCount" display 10944 which is 38 x 288.</p>

<p>Anyway I can make them display the correct values?</p>