select tillid ,sum(num) from
(select tillid,case when qty > 0 then (qty + 99)/100
when qty < 0 then (qty - 99)/100
end as num
FROM dstrans2
WHERE txdate = '2012-09-30') a
group by tillid
select tillid ,sum(num) from (select tillid,case when qty > 0 then (qty + 99)/100 when qty end as num FROM dstrans2 WHERE txdate = '2012-09-30') agroup by tillid