Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

split rows based on from and to dates

$
0
0

I have a row like this,

date_ref_keydatesales_week_start_datesales_week_end_date
201901062019-01-06 00:00:00.02019-01-06 00:00:00.02019-01-12 00:00:00.0

need to split like below

date_ref_keydatesales_week_start_datesales_week_end_date
201901062019-01-06 00:00:00.02019-01-06 00:00:00.02019-01-07 00:00:00.0
201901062019-01-06 00:00:00.02019-01-07 00:00:00.02019-01-08 00:00:00.0
201901062019-01-06 00:00:00.02019-01-08 00:00:00.02019-01-09 00:00:00.0
201901062019-01-06 00:00:00.02019-01-09 00:00:00.02019-01-10 00:00:00.0
201901062019-01-06 00:00:00.02019-01-10 00:00:00.02019-01-11 00:00:00.0
201901062019-01-06 00:00:00.02019-01-11 00:00:00.02019-01-12 00:00:00.0
201901062019-01-06 00:00:00.02019-01-12 00:00:00.02019-01-13 00:00:00.0

Thanks much in advance.


Naresh


Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>