• Did you modify the query at all?

    Having Datepart(hour) in the Group By should make it just return the hours. I just tested that, and it worked:

    create table #T (

    ID int identity primary key,

    TimeStampUTC datetime);

    insert into #T (TimeStampUTC)

    select '2008-01-01 05:00:00.000' union all

    select '2008-01-01 05:15:00.000' union all

    select '2008-01-01 05:30:00.000' union all

    select '2008-01-01 05:45:00.000' union all

    select '2008-01-01 06:00:00.000' union all

    select '2008-01-01 06:15:00.000' union all

    select '2008-01-01 06:30:00.000' union all

    select '2008-01-01 06:45:00.000' union all

    select '2008-01-01 07:00:00.000';

    select datepart(hour, TimeStampUTC)

    from #T

    group by datepart(hour, TimeStampUTC);

    I don't have your tables, so I can't test much beyond that, but this gives exactly what it's supposed to, and it should work the same way with your data.

    If you didn't modify the query, I need table definitions (create scripts) and sample data (insert scripts), so I can test it.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon