asi:
Código SQL:
Ver originalCREATE TABLE #temp(
id INT,
fecha datetime,
uso INT
)
INSERT INTO #temp VALUES (16301, '11/02/2012 19:57', 1 )
INSERT INTO #temp VALUES (16301, '11/26/2012 13:54', 1 )
INSERT INTO #temp VALUES (16301, '11/26/2012 14:25', 3 )
INSERT INTO #temp VALUES (16301, '11/26/2012 16:22', 4)
DELETE FROM #temp
SELECT t1.id,t1.fecha,SUM(t2.uso) FROM(
SELECT id,fecha,ROW_NUMBER() OVER(partition BY id,CONVERT(VARCHAR(20),fecha,101) ORDER BY id) rn,uso FROM #temp
) t1
LEFT JOIN (
SELECT id,fecha,ROW_NUMBER() OVER(partition BY id,CONVERT(VARCHAR(20),fecha,101) ORDER BY id) rn,uso FROM #temp
) t2 ON (CONVERT(VARCHAR(20),t1.fecha,101)=CONVERT(VARCHAR(20),t2.fecha,101))
WHERE (t2.rn<=t1.rn) GROUP BY t1.id,t1.fecha
Aclaro uso sql server 2008-2012