I need to calculate the actual number of days between a number of date ranges.
eg:
- 2014-01-01 to 2014-01-04 is 4 days
- 2014-01-05 to 2014-01-06 is 2 days
while
- 2014-02-01 to 2014-02-03 3 days with
- 2014-02-03 to 2014-02-05 3 days
is a total of 5 days
an added complication is that during a month there will be some gaps between date ranges and or overlapping date ranges to be taken into consideration
any ideas guys. ability to do the calc using mysql would be great.
Maybe i should have said count the number of days instead of calculate. I can get the number of days between two date ranges using either mysql or javascript as mentioned below, I think my wheels are coming off with the overlapping date ranges where one range starts before another has finished.