Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Filter by time only

Author  Topic 

jhaney
Starting Member

33 Posts

Posted - 2010-08-27 : 10:32:18
select * from clactivitylog
where eventtimestamp > '2010-08-26 17:00:00.000'
order by eventtimestamp

This query is the beginning of a report that I am righting. It looks at user activity in the DB. I need to be able to run it for a month and return just the time stamps that happen after 5pm. The above will get me each day but I am not sure how to do this over a date range.

Thanks

Joshua

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2010-08-27 : 10:54:34
where eventtimestamp > '2010-08-26 17:00:00.000' and datepart(hour,eventtimestamp) > 16

CODO ERGO SUM
Go to Top of Page

jhaney
Starting Member

33 Posts

Posted - 2010-08-27 : 15:31:08
Michael, I can't beleive it was that simple. Thank you very much.
Go to Top of Page
   

- Advertisement -