]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13626 fixed mssql compatibility issue in stats upgrade; merged from MOODLE_19_STABLE
authorskodak <skodak>
Mon, 25 Feb 2008 21:55:43 +0000 (21:55 +0000)
committerskodak <skodak>
Mon, 25 Feb 2008 21:55:43 +0000 (21:55 +0000)
lib/statslib.php

index 6cf571afabda48e5c8c1ac9bb8372ce0da56f665..3bedd07d705599b09a1d705a6a65912118ced521 100644 (file)
@@ -1444,11 +1444,11 @@ function stats_upgrade_totals() {
 
         $sql = "INSERT INTO {$CFG->prefix}stats_$type2 (stattype, timeend, courseid, roleid, stat1, stat2)
 
-                SELECT stattype, (timeend - $y30) AS ntimeend, courseid, 0, SUM(stat1), SUM(stat2)
+                SELECT stattype, (timeend - $y30), courseid, 0, SUM(stat1), SUM(stat2)
                   FROM {$CFG->prefix}stats_$type
                  WHERE (stattype = 'enrolments' OR stattype = 'activity') AND
                        roleid <> 0
-              GROUP BY stattype, ntimeend, courseid";
+              GROUP BY stattype, timeend, courseid";
         execute_sql($sql);
 
         $sql = "INSERT INTO {$CFG->prefix}stats_$type (stattype, timeend, courseid, roleid, stat1, stat2)