select *, (select sum(qty) from table where data > '2013/01/01' from table)
select count(qnt) from facsort group by DATEPART(yyyy, date )
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)