maybe you can try to invert the "nonbusyDay" logic:
Date | BusyDay | cumulCount
2011-01-01 | 0 | 0
2011-01-02 | 0 | 0
2011-01-03 | 1 | 1
2011-01-04 | 1 | 2
date | BusyDay | cumulCount
yyyy-mm-01 | 1 | 1234
yyyy-mm-02 | 0 | 1234
yyyy-mm-03 | 0 | 1234
yyyy-mm-04 | 1 | 1235
yyyy-mm-05 | 1 | 1236
yyyy-mm-06 | 0 | 1236
yyyy-mm-07 | 0 | 1236
yyyy-mm-08 | 1 | 1237
yyyy-mm-09 | 0 | 1237
Then the cumulCount of the start yyyy-mm-01 is 1234 and the end ist 1237 (delay - 1 -> if the first day counts too)
I think this is easy to handle with TOS
Partager