datetime
declare @BaseDate datetime = '2016-01-01' select top 10 BatchDate = dateadd(SECOND, datediff(SECOND, @BaseDate, UpdatedOn), @BaseDate) ,Qty = count(2) from dbo.UploadedData where 1=1 and UpdatedOn >= '2016-10-10' group by dateadd(SECOND, datediff(SECOND, @BaseDate, UpdatedOn), @BaseDate)