try something like this:select dateadd(day, datediff(day, 0, YourDateColumn), 0) as [Day] ,count(*) as [DayCount]from yourTableGroup by dateadd(day, datediff(day, 0, YourDateColumn), 0)
EDIT:Here is a sample implementation of the above:set nocount ondeclare @tb table (i int, d datetime)insert @tbselect 1, getdate() union allselect 1, getdate() union allselect 1, getdate()-1 union allselect 1, getdate()-1 union allselect 1, getdate()-2 union allselect 1, getdate()-2select convert(varchar,d,101) [Date] ,c DateCountfrom ( select dateadd(day, datediff(day, 0, d), 0) d ,count(*) c from @tb Group by dateadd(day, datediff(day, 0, d), 0) ) a
Be One with the OptimizerTG