From 2c20af9c75821844e579cec55f42588e62526f39 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 25 Feb 2008 21:55:43 +0000 Subject: [PATCH] MDL-13626 fixed mssql compatibility issue in stats upgrade; merged from MOODLE_19_STABLE --- lib/statslib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/statslib.php b/lib/statslib.php index 6cf571afab..3bedd07d70 100644 --- a/lib/statslib.php +++ b/lib/statslib.php @@ -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) -- 2.39.5