select t1.fprodname,SUM(t1.fqty)fqty,SUM(t1.famount)famount from DSBCRM..tcustomer_order t1
inner join DSBCRM..tcustomer_reception t2  on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid and t1.tcustomer_receptid=t2.tcustomer_receptid
inner join DSBCRM..tagents t3 on t1.siteid=t3.siteid and t1.tagentsid=t3.tagentsid
where t1.siteid=$siteid$ and
convert(varchar(7),t2.fdate,120)>=$fbegmonth$ and convert(varchar(7),t2.fdate,120)<=$fendmonth$
and t3.fsaleruserid in $tenterprise_userid$
group by t1.fprodname  order by SUM(t1.fqty) desc