Ver originalSELECT MAX(valor), CAST(DateDiff(DAY,0,fecha)) AS fecha FROM tabla GROUP BY CAST(DateDiff(DAY,0,fecha))