select t1.fcommunity,count(t1.fcommunity)fcount from DSBCRM..tcustomer_reception t1
inner join DSBCRM..tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
where t1.ftype='ÏúÊÛ' and t1.siteid=$siteid$ and
convert(varchar(7),t1.fdate,120)>=$fbegmonth$ and convert(varchar(7),t1.fdate,120)<=$fendmonth$ and isnull(t1.fcommunity,'')!=''
group by t1.fcommunity