Need to populate gap records if gaps exists between 2 consecutive statuses

Database
Enthusiast

Need to populate gap records if gaps exists between 2 consecutive statuses

Hi All,

I need to populate gap records for the below requirement

Selection criteria is :  processed date between jan2015 and dec2015.

Here in my source date ,Enrolled and On-Hold Statuses are available and have gaps in the active enrollment period between statuses, then it is required to replicate the status/record until next available enrolled/On-Hold status record is available. 

Source table as below

PID Enrolled Date Status Processed date

1234 01/27/2015 Enrolled Jan-2015

1234 01/27/2015 On-Hold April-2015

1234 01/27/2015 Enrolled July-2015

My Output should display as below:

PID Enrolled Date Status Processed date

1234 01/27/2015 Enrolled Jan-2015

1234 01/27/2015 Enrolled Feb-2015  ------replicated

1234 01/27/2015 Enrolled March-2015  ------replicated

1234 01/27/2015 On-Hold April-2015

1234 01/27/2015 On-Hold May-2015  ------replicated

1234 01/27/2015 On-Hold June-2015 ------replicated

1234 01/27/2015 Enrolled July-2015

1234 01/27/2015 Enrolled Aug-2015  ------replicated

1234 01/27/2015 Enrolled sept-2015  ------replicated

1234 01/27/2015 Enrolled Oct-2015  ------replicated

1234 01/27/2015 Enrolled Nov-2015  ------replicated

1234 01/27/2015 Enrolled Dec-2015  ------replicated