I have a fact table that tracks multiple actions and dates for a specific population. I am having a hard time creating a query that returns the resultset I would expect for this table. Here is a sample of this table:
Record applicant_count applicant_date accepted_count accepted_date registered_count registered_date
1 1 3 03/01/2014
2 1 2 02/01/2014 1 3 03/01/2014 1 5 05/05/2014
3 1 1 01/01/2014 1 5 05/01/2014 1 5 05/01/2014
4 1 2 02/01/2014 1 4 04/15/2014
5 1 4 04/01/2014
There are 5 records with 5 applications, 3 accepted, and 2 registered records for the entire set. I need to know how to write a query that can calculate these counts for a specific date, say 4/20/2014. On that day I would like to have the query return 5 applicants, 2 accepted, and 0 registered. Any help would be appreciated.