Skip to content
Advertisement

Split single row into multiple rows based on Date and time in SQL Server

I want to split a single row into multiple rows based on time. below are the example.

Expected output is below:

Day start from 06:00 AM to next day 06:00 AM. When EndDate time is grated than 06:00 AM then split this date in two rows. first row end date is 2018-08-21 05:59:00.000 and next row start 2018-08-21 06:00:00.000.

Advertisement

Answer

Below Query will help you.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement