I am stuck with this error and unable to progress.
Any idea on this error?
CASE WHEN mm.[Moodle Courses Category] + '_' +ISNULL(RIGHT(ttg.TTGP_Group_Code, LEN(ttg.TTGP_Group_Code)-11),'V1') like '%/%' THEN
mm.[Moodle Courses Category] + '_' +ISNULL(RIGHT(ttg.TTGP_Group_Code, LEN(ttg.TTGP_Group_Code)-11),'V1')
ELSE
mm.[Moodle Courses Category] + '_' +ISNULL(RIGHT(ttg.TTGP_Group_Code, LEN(ttg.TTGP_Group_Code)-11),'V1') END AS GROUP_ID
Error: Msg 536, Level 16, State 2, Line 1 Invalid length parameter passed to the RIGHT function.