A suiting WHEN-clause was not found in aCASE-statement, which means that the CASE-statement did not execute a query.
Modify the CASE-statement in a way enabling at least one WHEN-clause to always fulfill the condition. If this should not be possible then use a ELSE-clause.