In your group by clause, shift the time by 7. As an example, I am trying to count the devices for each date, but my dates are 24 hour periods starting at 7:00 AM instead of the conventional 24 hour period starting at midnight.CREATE TABLE #tmp(datestamp DATETIME, devices INT);INSERT INTO #tmp VALUES ('2012-08-12T05:00:00.000',50), ('2012-08-12T08:00:00.000',10), ('2012-08-13T02:00:00.000',41), ('2012-08-14T17:11:00.000',41); DECLARE @shiftStart INT = 7; -- Day starts at 7:00 AM SELECT CAST(DATEADD(hh,-@shiftStart,datestamp) AS DATE) AS NominalDate, SUM(devices)FROM #tmpGROUP BY CAST(DATEADD(hh,-@shiftStart,datestamp) AS DATE); DROP TABLE #tmp;If you are on SQL 2005 or earlier, the CAST to DATE won't work, , in that case, replace it with:DATEADD(dd,DATEDIFF(dd,0,(DATEADD(hh,-@shiftStart,datestamp))),0)