Link to home
Start Free TrialLog in
Avatar of Butterfly2
Butterfly2

asked on

capturing a count at a specific point in time

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
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Butterfly2
Butterfly2

ASKER

I have  a job scheduled that populates a table the with the student poplulation daily