Hi
Pls Help, I have this transform stmt within a Sp which I wish to use
inorder to output the results similar to a crosstab qry...so my ? is can
I use this code and if so why do I recieve an error
The errors areCode:if @ReportType = 'MonthlyCounts' begin TRANSFORM count(CQuote_int)as Quotes SELECT DateName(Month, ReportDate) Month from #transactionstable WHERE (DATEPart(YYYY, ReportDate) = DATEPart(YYYY, GetDate()) GROUP BY DateName(Month, ReportDate), datePart(MM,ReportDate) ORDER BY order by datePart(MM,ReportDate) PIVOT transactionstable.Month; /* select DateName(Month, ReportDate) Month, sum(CQuote_int)Quotes ,sum(CReferral_int)Referrals , sum(CNewBus_int) Policies from #transactionstable where DATEPart(YYYY, ReportDate) = DATEPart(YYYY, GetDate()) group by DateName(Month, ReportDate), datePart(MM,ReportDate) order by datePart(MM,ReportDate) */ end
Ta very muchCode:Server: Msg 170, Level 15, State 1, Procedure Tonyg_ReportChart_GetBDOnlineMonthlyCountsNew1, Line 123 Line 123: Incorrect syntax near 'TRANSFORM'. Server: Msg 156, Level 15, State 1, Procedure Tonyg_ReportChart_GetBDOnlineMonthlyCountsNew1, Line 127 Incorrect syntax near the keyword 'GROUP'


Reply With Quote
