I have this data:
CREATE TABLE
October 5, student2 updated to inactive
UPDATE
October 8, student2 updated to active :
UPDATE
On October 9, I created another student:
INSERT INTO
October 10th I have this data in the tables.
select * from #student select * from #student_status_history
Using the above tables
I have to generate a report on October 10 from October 10 to October 10 of active students as of this day
The output should be lower
Date ActiveCount ----------- ----------- 2016-10-01 0 2016-10-02 3 2016-10-04 3 2016-10-05 2 2016-10-06 2 2016-10-07 2 2016-10-08 3 2016-10-09 4 2016-10-10 4
source share