try select year(proddate) as prodyear, sum(prodqty) as qtytot, sum(prodvalue) as valtot from temp01 group by prodyear i have included some code below to show how that would be used
create cursor temp01 (proddate d, prodref c(7), prodqty n(6,0), prodprice n(6,2), prodvalue n(10,2))
index on...