MDL-41967 - Gradebook: Fixed an sql syntax error for gradebook custom profile fields.