I am trying to query a data set where I can get a full count of status on a given set of days. The data would look like this
Customer ID Status Date
1 pending 2020-01-01
1 shipped 2020-01-04
1 delivered 2020-01-06
The problem is the status needs to carry over to each of the preceding days so I can sum all status' at the end. So in a perfect world the data would look like this
Customer ID Status Date
1 pending 2020-01-01
1 pending 2020-01-02
1 pending 2020-01-03
1 shipped 2020-01-04
1 shipped 2020-01-05
1 delivered 2020-01-06
This would allow me to sum the data set appropriately at the end of the query. I have a table of dates I can join to, but I am struggling to figure out how to fill in the dates that fall between the status changes.
Thanks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…