I have a start_date and end_date. I want to get the list of dates in between these two dates. Can anyone help me pointing the mistake in my query.
id state start_date end_date
------------------------------------------------------------------------
2 New 2016-02-24 2016-02-28
2 Active 2016-02-28 2016-03-01
2 New 2016-03-01 NULL
3 New 2016-02-23 2016-02-25
3 Active 2016-02-25 2016-02-27
3 New 2016-02-27 NULL
id state start_date end_date
------------------------------------------------------------------------
2 New 2016-02-24 2016-02-25
2 New 2016-02-25 2016-02-26
2 New 2016-02-26 2016-02-27
2 New 2016-02-27 2016-02-28
2 Active 2016-02-28 2016-02-29
2 Active 2016-02-29 2016-03-01
2 New 2016-03-01 NULL
3 New 2016-02-23 2016-02-24
3 New 2016-02-24 2016-02-25
3 Active 2016-02-25 2016-02-26
3 Active 2016-02-26 2016-02-27
3 New 2016-02-27 NULL
BETWEENworks just fine with dates. It won't work if you use stringds instead of dates. You didn't post any query.start_dateandend_datejoin with a calendar table usingON Calendar.Date between start_date and end_dateas the condition.