Index: field.class.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/data/field/date/field.class.php,v retrieving revision 1.5 diff -c -r1.5 field.class.php *** field.class.php 13 Dec 2006 20:26:13 -0000 1.5 --- field.class.php 9 Jan 2008 22:24:13 -0000 *************** *** 75,89 **** function display_browse_field($recordid, $template) { - global $CFG; - if ($content = get_field('data_content', 'content', 'fieldid', $this->field->id, 'recordid', $recordid)){ return userdate($content, get_string('strftimedate'), 0); } } function get_sort_sql($fieldname) { ! return 'CAST('.$fieldname.' AS unsigned)'; } --- 75,101 ---- function display_browse_field($recordid, $template) { if ($content = get_field('data_content', 'content', 'fieldid', $this->field->id, 'recordid', $recordid)){ return userdate($content, get_string('strftimedate'), 0); } } function get_sort_sql($fieldname) { ! ! global $CFG; ! ! switch ($CFG->dbfamily) { ! case 'mysql': ! return 'CAST('.$fieldname.' AS signed)'; ! break; ! case 'postgres': ! case 'mssql': ! return 'CAST('.$fieldname.' AS bigint)'; ! break; ! case 'oracle': ! return 'TO_NUMBER('.$fieldname.')'; ! break; ! } }