Count days within a month from date range
- by G. Muqtada
I have three date ranges in mysql table as follow
from 2013-09-29 to 2013-10-02
from 2013-10-14 to 2013-10-16
from 2013-10-28 to 2013-11-05
I want to count only days that occur in Month of October, for example from first range (2013-09-29 to 2013-10-02) I should get difference of two days (1st and 2nd October) , and it should ignore days from September month, Finally i want to count total days in a given month from above date ranges.
Can it be done from direct mysql query. or any short PHP logic.