Show me the monthly count If my start & end date falls in between those dates in SQL query

by sujith raj   Last Updated September 14, 2018 15:06 PM

I have below sample data with start & end dates. What i want is count that particular row each month if my start or end date is between that month.

For example Start Date 01/01/2018 End Date 31/12/2018 then i should be able to show that record each month like Jan 1 feb 1 March 1 April 1 etc until the end date of that row is completed and the cycle repeats for every rows start & en date. Desired output in the second screenshot. Please Help

enter image description here

enter image description here

Tags : sql


Related Questions