Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


capturing  a count at a specific point in time

Posted on 2014-08-14
Medium Priority
Last Modified: 2014-08-19
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]
  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.
Question by:Butterfly2
LVL 49

Accepted Solution

PortletPaul earned 2000 total points
ID: 40260412
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.

Author Comment

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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question