I think I tried that before but anyway I put it back in full sql is:SELECT student_id, acad_period, register_id, register_group, week_no, absence_code, attendance_typeFROM dbo.sttdstudWHERE (student_id LIKE @stuID + '%') AND (register_id LIKE @regID + '%') AND (register_group LIKE @regGroup + '%') AND Case when week_no = '' Then '#' Else @Week End
got an unable to parse error. I should say this is in a c# table adapter query (incase it's important).