protected function filter_by_letter($letter, $finalfield) {
        global $DB;

        $letter = core_text::strtoupper($letter);
        $len = core_text::strlen($letter);
        $sql = $DB->sql_substr(sprintf('upper(%s)', $finalfield), 1, $len);

        $this->where[] = "$sql = :letter";
        $this->params['letter'] = $letter;
    }