select
sdate,
SUM(case when CGrp!='TOWNSHIP' and cdcode=0 and SDate between '4/1/2013' and '4/1/2013' then BillAmt end) as bill,
sum(case when CGrp!='TOWNSHIP' and cdcode!=0 and SDate between '4/1/2013' and '4/1/2013' then BillAmt end) as Net
from Indent
where bill != null
group by SDate
错误消息指向与bill != null