Apr 26, 2018 06:50 AM|Deepak Panchal|LINK
Did you check the query that made by case statement?
I suggest you to first store your query as text in variable.
So you can easily append variable to it.
Then try to execute that query may help you to run your query without any error.
If issue persist then try to post the post the full query.
It will help us to understand the issue in better way.