troubleshooting Question

SQL Time In and Time Left - How Many Are Here?

Avatar of dastaub
dastaubFlag for United States of America asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008SSRS
13 Comments2 Solutions546 ViewsLast Modified:
I have rows with a Time Stamp of when someone arrives and a TimeStamp of when the same person leaves.  Each person is identified when they arrive and leave, it is not a simple count of INs and OUTs  Each person's TimeIn and TimeOut are recorded in the same row.
I need an idea for a query that will tell me the count of people who are IN at any point in time?
I can tell you how many people arrived between time A and B or how many left between time A and B, but I'm not clear on calculating how many are present at time A or present at time B?
ASKER CERTIFIED SOLUTION
Ephraim Wangoya
Software Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 13 Comments.
Start Free Trial
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 2 Answers and 13 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