troubleshooting Question

capturing  a count at a specific point in time

Avatar of Butterfly2
Butterfly2 asked on
Microsoft SQL Server 2008
2 Comments1 Solution130 ViewsLast Modified:
Good Morning experts,

I have been tasked to do a weekly report based on application usage for each school and then show what percent of the student and teacher poplulation are using the application.  The thing is that the over all population at each school may change from week to week.  I can get the population as of today but I want to capture the population based on the time frame i run the report.  For example if I am looking at app usage from Aug 4 to aug 10 I want to get the student population as of August 4th not as today.  I do have an enrollment delta table I am using.  

SELECT  [deptcode]
      ,[SchCode]
      ,[empno]
      ,[orgrole]
      ,[status]
      ,[modStatus]
      ,[modDt]
  FROM [GSDR].[d2l].[GCPS_OUX_Enrollments_School_delta]

SchCode      empno      orgrole      status      modStatus      modDt
643      200100009      Student      1      1      7/22/2014 23:01
196      200100306      Student      1      1      7/22/2014 23:01
225      200100354      Student      1      1      7/22/2014 23:01
750      200100354      Student      1      1      7/22/2014 23:01
750      200100359      Student      1      1      7/22/2014 23:01
439      200100362      Student      1      1      7/22/2014 23:01
439      200100605      Student      1      1      7/22/2014 23:01


mod status of 1 is enrolled, mod status if 0 is disenrolled the modDt field is the day the modificaton was made.  I tried doing a count a grouping by schCode but the didnt work.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 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 1 Answer and 2 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