I have the longest comnined case statement i have done ever and I cannot troubleshoot this error. IT says its a syntax error near ) which I am fully embarrassed that I cannot figure out such a simple error
SUM(CASE
WHEN COL_V_STD_REP_FullCourseDetail.SYSTEM = 'GEMS'
THEN CASE
WHEN RRDD LIKE '12%' OR RRDD LIKE '13%' OR RRDD LIKE '16%' OR
RRDD LIKE '17%' OR RRDD LIKE '2706%' OR RRDD LIKE '2707%' OR
RRDD LIKE '2331%'
THEN [DUR_IN_Hours]
ELSE 0
END) AS SP_DOM_INTL_HRS
You are missing the second
END:Just as a side note, if you format your code you will have an easier time finding these issues.