I have the following mysql query
select registration,
sum(`week01`) as `2015/01`,
sum(`week02`) as `2015/02`
from (select registration,
case when concat(YEAR(act_del_time_arrive),'/',week(act_del_time_arrive))='2015/01' then round(costed_amount,0) else '' end 'week01' ,
case when concat(YEAR(act_del_time_arrive),'/',week(act_del_time_arrive))='2015/02' then round(costed_amount,0) else '' end 'week02'
from vw_tekwani_schedule_main
where act_del_time_arrive between '2015-01-04' and '2015-02-28'
and haulier_id = 4 and registration is not null
group by registration, date(act_del_time_arrive)
order by registration) as t group by registration
which is producing the following results
reg 2015/01 2015/02
'A10' , '0' , '0'
'A2' , '0' , '0'
'A3' , '0' , '0'
'A4' , '0' , '0'
'A5' , '0' , '0'
'A6' , '0' , '0'
'A7' , '0' , '0'
'A8' , '0' , '0'
'A9' , '0' , '0'
I desperately need to find out how to filter the rows off that have a zero value on 2015/01 and 2015/02.
So theoretically I would not get a result being returned from this query
WHERE '2015/02' != 0 ...not work?