how to solve for the error i have been getting when using group by clause for the below query .What am i doing wrong?
SELECT RR.REQUESTID,count(CD.totalsubs) as Subscribers,count(CD.Totalmem) as Members,RD.rptdesctext,Recp.emailadr
FROM report_request RR inner join Selected_report SR on RR.requestid = SR.requestid inner join REport_description RD on SR.rptdesc = RD.rptdesc inner join Recepients Recp on RR.requestid = Recp.requestid inner join customer_detail CD on RR.MSGN = Cd.msgn
where SR.completeddt between '1/1/2012' and '12/31/2012'
and RR.reportfrequency != 'One Time'
Cannot use an aggregate or a subquery in an expression used for the group by list of a GROUP BY clause.