Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Isse with using Grouping Sets in SQL Server 2008 R2

$
0
0

Hi,

I created a query in SQL Server 2012 using grouping sets that works fine.  When I try to use the same query in SQL Server 2008 I get an error ("Inccorrect syntax near SETS").

I researched using grouping sets in 2008 and didn't see any issue with my query.  What is different in grouping sets 2008 vs 2012?

SELECT tl.ClientRegionCd as [Client Region Code] , tl.ClientRegionDesc as [Region Name], count(tl.CompleteICN) as [Trauma Letters Sent]
	from TORT_Trauma_Letters tl
	Where CONVERT(VARCHAR(26), tl.SecondNoticeSent, 23) between '2014-06-12' and '2014-06-12'
	GROUP BY GROUPING SETS((tl.ClientRegionCd, tl.ClientRegionDesc), ())


Stacie


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>