Experts Exchange connects you with the people and services you need so you can get back to work.
select CAST(LogDateTime AS Date) as LogDate
, datepart(hh, LogDateTime) as Hour
, Sum(Entries) as Entries
, Sum(Exits) as Exits
Group By CAST(LogDateTime AS Date)
, datepart(hh, LogDateTime)
Open in new window
select dateadd(hour, datediff(hour, 0, logdatetime), 0) as loghour,
sum(entries) as entries, sum(exits) as exits)
-- where <any condition>
group by dateadd(hour, datediff(hour, 0, logdatetime), 0)
order by dateadd(hour, datediff(hour, 0, logdatetime), 0);
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.