similar to Bill's query but i would not use DATEPART(DAYOFYEAR, Time) as this is only valid for one year data. If you have more than 1 year data, you will be grouping it wrongly like 2009-02-01 with 2010-02-01 as both will give you the same value for DATEPART(DAYOFYEAR, Time).Use DATEADD(DAY, DATEDIFF(DAY, 0, Time), 0) to strip of the time component of the TIME column for grouping / partioning.;WITH RankedRealTimeData AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY DATEADD(DAY, DATEDIFF(DAY, 0, [Time]), 0) ORDER BY [Time] DESC) AS RN FROM RealTimeData)SELECT DATEADD(DAY, DATEDIFF(DAY, 0, [Time]), 0), ValueFROM RankedRealTimeData WHERE RN = 1;
KH[spoiler]Time is always against us[/spoiler]