select fcommunity,
       count(fcommunity) fcount,
       MIN(forderamount) fminorderamount,
       MAX(forderamount) fmaxorderamount,
       AVG(forderamount) favgorderamount
from tcustomer_reception
where ftype = 'ÏúÊÛ'
  and siteid =$siteid$
  and tagentsid=$tagentsid$
  and
    convert (varchar (7)
    , fdate
    , 120)>=$fbegmonth$
  and convert (varchar (7)
    , fdate
    , 120)<=$fendmonth$ and isnull(fcommunity,'')!=''
group by fcommunity


