troubleshooting Question

Need to get Time Range in log file from timestamp entries

Avatar of bascdfj
bascdfj asked on
Microsoft SQL ServerMicrosoft SQL Server 2005
14 Comments1 Solution342 ViewsLast Modified:
Hi All -
I have a table with timestamp entries as follows:

UserID
Timestamp

This table is written to every time a user does certain things in the application (like moving between certain pages in the web application). I want to see an aggregate of activity within a certain range of time.

For example, for each day in a time period (say between july 1 and dec 31), I want to see any activity between the first entry for the day and the last entry for the day grouped by hour.

Example:

For Oct 1st, person A showed 5 activity entries between 8:am and 9:am, 12 between 9am and 10am, 7 between 11am and 12 noon, and 22 between 2:pm and 3pm.

Ideally this would show results only for days that have activity, and only hour periods that have activity. This way I can see if there are any big holes in activity during a give day.

Is there a way to do this entirely with SQL?

Many thanks
Ford

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros