问题
I've tried to use the search function and found a similar question. However, I can't get it to work properly.
I have a simple table that shows incoming and ended e-mails (tasks). There's an ingoing and ended-date.
For analysis I want to show (historical) the number of open/unanswered e-mails for a given day back in time. The output should answer the question: "What was the number of open tasks yyyy-mm-dd?".
The number of open tasks a given day (yyyy-mm-dd) should be
Count WHERE Date_IN < yyyy-mm-dd
AND Date_END >= yyyy-mm-dd
OR Date_IN < yyyy-mm-dd AND Date_END Is Null
Hope this makes sense. It's a pretty simple "inventory report" where the inventory is tasks.
I've tried to draw an output-example (When Date_END Is Null then task is still open).
来源:https://stackoverflow.com/questions/19382314/sql-count-open-tasks-each-day