1: 2: 3: 4:
select product, sum (quantity) as QTY,(datename(mm,dated) + datename(yyyy,dated)) as mmyy from scheme.opsadetm group by product, (datename(mm,dated) + datename(yyyy,dated)) order by mmyy desc