I have the following query which works great on SQL Server 2012:
SELECT Name,
WeekNumber,
SUM(NumberOfSecondsWorked) AS totalDaily,
StartTime,
EndTime,
SUM(SUM(NumberOfSecondsWorked)) OVER (PARTITION BY WeekNumber ORDER BY EndTime) AS totalWeekly
FROM #temp AS T1
But unfortunately I get the following error when running this query on a SQL Server 2008 DB:
Incorrect syntax near 'order'.
My desired outcome of the above query is to add the NumberOfSecondsWorked by Day for each week. Here is my desired output:
But without the ORDER BY, I just get a total for each week without the increment by day:
Anybody know how to run the above query in SQL Server 2008? Or a mechanism to get the same result? Thanks!