The following link explains how to turn a date range into a list of dates.
I used this approach and it works fine but the query is not performing (I used Maxrecursion 0 to unlimit).
http://blog.justinstolle.com/sql-turn-a-date-range-into-a-list-of-dates/
Is there any other solution to get this done? (using subquery or declare table?)
Try
If your date range is more than 2047 days, you can extend it by self joining the table – the below will allow you up to 27 years..