I am pretty sure it has something to do with having multiple case statements.
I've the following code which gives me an syntax error:
sum(CASE when `Date` >= (DATE_ADD(CURRENT_DATE(),interval -15 day)) and `Date` <= (DATE_ADD(CURRENT_DATE(),interval -1 day)) then
(case when `ConversionTypeName` like '%Sale%' then `Conversionsvalue`) else 0 end)
But when I use this it workings just fine:
sum(CASE when `Date` >= (DATE_ADD(CURRENT_DATE(),interval -15 day)) and `Date` <= (DATE_ADD(CURRENT_DATE(),interval -1 day)) then
(`ConversionValue`) else 0 end)
How can I fix this?
Thanks in advance