I have a table Named Bills and it holds data like this
BillID | From_date | To_date
-----------+------------+------------
3 | 2017-01-01 | 2017-01-30
6 | 2017-02-06 | 2017-02-25
8 | 2017-02-05 | 2017-02-28
I want to Get DAYs of data between two dates from a date range
For example, if I am searching between 2017-01-25 and 2017-02-02
result is:
6 Day. because between (2017-01-25 and 2017-02-02) and my table 9 days is shared
example 2, if I am searching between 2017-01-01 and 2017-01-05
result is:
5 Day. because between 2017-01-01 and 2017-01-05 and my table 5 days is shared