select sum(ViewCount), cast(ViewDate as date) from [dbo].[Table] where ViewDate>DATEADD(day,-30,getdate()) group by cast(ViewDate as date)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)