• Phil Parkin - Thursday, February 15, 2018 7:20 AM

    subramaniam.chandrasekar - Thursday, February 15, 2018 6:36 AM

    TheSQLGuru - Wednesday, February 14, 2018 3:00 PM

    In the meantime, checkout DATEPART in books online. That and GROUP BY will be in your solution I think.

    Can't we use normal conventional Group by here ?

    I see no mention of using an unconventional GROUP BY, so I don't understand the reason for your comment.

    If the underlying date data types contain time information – and we must assume that they do, based on the requirement – then DATEPART can be used to break these datetimes out into hourly blocks, before grouping them.

    It was actually a wrong ping / comment to your quote, Apologies. thought of replying OP:hehe: