I’m trying to create query that will return how many cases were aged over one day by date. In other words, how many cases were not resolved on day created and were outstanding on each specified day. This is to look at historical performance of resolution and how many each day were over one day old. I can accomplish this easily with excel, but I have around 1 million cases/rows to count and excel just can’t handle that all at once. I know the basics of SQL, but I’m not sure how to accomplish by an SQL query.
On excel, I have a variable that is list of calendar dates I want a result for, and then using COUNTIFS the formula looks at the data and counts what meets the criteria. I don’t know where to begin to translate that to SQL. I’m using MS Access.
Hopefully, using the below example data as solved with Excel will assist in explaining what I’m attempting to accomplish.
Example data
Case_ID Create_Date Resolved_Date
1 1/1/2013 1/2/2013
2 1/1/2013 1/3/2013
3 1/1/2013 1/4/2013
4 1/1/2013 1/5/2013
5 1/2/2013 1/5/2013
6 1/2/2013 1/5/2013
7 1/4/2013 1/5/2013
8 1/4/2013 1/5/2013
9 1/5/2013 1/5/2013
10 1/5/2013 1/5/2013
11 1/6/2013 1/9/2013
12 1/7/2013 1/10/2013
13 1/7/2013 1/9/2013
14 1/8/2013 1/12/2013
15 1/8/2013 1/13/2013
16 1/8/2013 1/9/2013
17 1/8/2013 1/11/2013
18 1/8/2013 1/11/2013
19 1/9/2013 1/11/2013
20 1/10/2013 1/14/2013
Excel results with formula "=COUNTIFS(Create_Date,"<"&E2,Resolved_Date, ">"&E2)" <- "E2" Is just the cell reference of "1/1/2013."
Column(E) Column(F)
Date Count of Aged Cases
1/1/2013 0
1/2/2013 3
1/3/2013 4
1/4/2013 3
1/5/2013 0
1/6/2013 0
1/7/2013 1
1/8/2013 3
1/9/2013 5
1/10/2013 5
1/11/2013 3
1/12/2013 2
1/13/2013 1
1/14/2013 0