I have below Data
ID | New Date | OldStartDateTIme | oldEndDateTime |
1 | 20-11-2021 | 18-11-2021 08:00 | 18-11-2021 14:00 |
1 | 20-11-2021 | 18-11-2021 14:00 | 18-11-2021 14:30 |
1 | 20-11-2021 | 18-11-2021 14:30 | 18-11-2021 16:30 |
2 | 19-11-2021 | 18-11-2021 22:15 | 19-11-2021 04:15 |
2 | 19-11-2021 | 19-11-2021 04:15 | 19-11-2021 04:45 |
2 | 19-11-2021 | 19-11-2021 04:45 | 19-11-2021 06:45 |
3 | 20-11-2021 | 19-11-2021 08:00 | 19-11-2021 14:00 |
3 | 20-11-2021 | 19-11-2021 14:00 | 19-11-2021 14:30 |
3 | 20-11-2021 | 19-11-2021 14:30 | 19-11-2021 16:30 |
4 | 20-11-2021 | 15-11-2021 08:00 | 15-11-2021 14:00 |
4 | 20-11-2021 | 15-11-2021 14:00 | 15-11-2021 14:30 |
4 | 20-11-2021 | 15-11-2021 14:30 | 15-11-2021 16:30 |
5 | 15-11-2021 | 18-11-2021 00:45 | 18-11-2021 04:45 |
5 | 15-11-2021 | 18-11-2021 04:45 | 18-11-2021 05:15 |
5 | 15-11-2021 | 18-11-2021 05:15 | 18-11-2021 08:15 |
6 | 15-11-2021 | 20-11-2021 00:15 | 20-11-2021 04:15 |
6 | 15-11-2021 | 20-11-2021 04:15 | 20-11-2021 04:45 |
6 | 15-11-2021 | 20-11-2021 04:45 | 20-11-2021 07:45 |
7 | 20-11-2021 | 18-11-2021 08:00 | 18-11-2021 14:00 |
7 | 20-11-2021 | 18-11-2021 14:00 | 18-11-2021 14:30 |
7 | 20-11-2021 | 18-11-2021 14:30 | 18-11-2021 16:30 |
8 | 14-11-2021 | 17-11-2021 00:00 | 17-11-2021 04:00 |
8 | 14-11-2021 | 17-11-2021 04:00 | 17-11-2021 04:30 |
8 | 14-11-2021 | 17-11-2021 04:30 | 17-11-2021 07:30 |
9 | 15-11-2021 | 19-11-2021 00:30 | 19-11-2021 04:30 |
9 | 15-11-2021 | 19-11-2021 04:30 | 19-11-2021 05:00 |
9 | 15-11-2021 | 19-11-2021 05:00 | 19-11-2021 08:00 |
10 | 20-11-2021 | 19-11-2021 08:00 | 19-11-2021 14:00 |
10 | 20-11-2021 | 19-11-2021 14:00 | 19-11-2021 14:30 |
10 | 20-11-2021 | 19-11-2021 14:30 | 19-11-2021 15:30 |
11 | 14-11-2021 | 20-11-2021 00:00 | 20-11-2021 04:00 |
11 | 14-11-2021 | 20-11-2021 04:00 | 20-11-2021 04:30 |
11 | 14-11-2021 | 20-11-2021 04:30 | 20-11-2021 07:30 |
12 | 19-11-2021 | 20-11-2021 23:00 | 21-11-2021 06:00 |
12 | 19-11-2021 | 21-11-2021 06:00 | 21-11-2021 06:30 |
12 | 19-11-2021 | 21-11-2021 06:30 | 21-11-2021 07:30 |
13 | 15-11-2021 | 19-11-2021 00:30 | 19-11-2021 04:30 |
13 | 15-11-2021 | 19-11-2021 04:30 | 19-11-2021 05:00 |
13 | 15-11-2021 | 19-11-2021 05:00 | 19-11-2021 08:00 |
14 | 14-11-2021 | 18-11-2021 23:15 | 19-11-2021 03:15 |
14 | 14-11-2021 | 19-11-2021 03:15 | 19-11-2021 03:45 |
14 | 14-11-2021 | 19-11-2021 03:45 | 19-11-2021 06:45 |
15 | 15-11-2021 | 19-11-2021 00:30 | 19-11-2021 04:30 |
15 | 15-11-2021 | 19-11-2021 04:30 | 19-11-2021 05:00 |
15 | 15-11-2021 | 19-11-2021 05:00 | 19-11-2021 08:00 |
The Requirement is to replace the old Dates with the new Date Column. and the duration of old dates and duration ofter the change should match..
I tried using replacing the Dates .. but the issue is for ex: for the ID : 12 , the old TIme start on 20 and end on 21, , I need that replaced with the appropriate Dates based on Old TImings.
Any workaround would be highly appreciated.
GROUP BY : ID, each ID the shift timing should fall on appropriate Start and End Dates based on the old Timings and Duration
Thank you so much:)
Hi,
@dkma I am afraid I do not fully understand how the output should look like.
Could you please show on an example?