Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count # of entries each hour

Status
Not open for further replies.

kvang

Programmer
Oct 7, 2005
129
US
I have an audit log table with a datetime column. I want to count the number of entries each hour.

AUDITLOGID F_TIMESTAMP
1 8/2/2006 5:16:47 PM
2 8/2/2006 5:38:30 PM
3 8/2/2006 6:23:30 PM
4 8/2/2006 8:03:30 PM

Any help is appreciated.
 
select trunc(f_timestamp,'HH'), count(auditlogid)
from auditlogtable
group by trunc(f_timestamp,'HH')

or HH24

-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top