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.
Butterfly2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PortletPaulfreelancerCommented:
There isn't sufficient information in that table to give you a "point in time" capability. Although you will know the date/time of a change, you won't then know the date of the former change, or the former change etc etc

You will need to run a "weekly snapshot" query for "get the population as of today" and store it, with the date/time you ran the weekly snapshot.

You could run this as a scheduled job once you have the logic sorted out.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Butterfly2Author Commented:
I have  a job scheduled that populates a table the with the student poplulation daily
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.