Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table that contains machine id, start date, end date, and status. I need to fill the missing date with the last status of machine.
MachineID | StartDate | EndDate | Status | Data_Date | Duration Hrs |
1EQ | 11/12/2021 6:00 | 11/12/2021 11:30 | Running | 11/12/2021 | 5.5 |
1EQ | 11/12/2021 11:30 | 11/12/2021 13:10 | In Setup | 11/12/2021 | 1.7 |
1EQ | 11/12/2021 13:10 | 11/12/2021 23:41 | Running | 11/12/2021 | 10.5 |
1EQ | 11/12/2021 23:41 | 11/13/2021 4:02 | IDLE | 11/12/2021 | 4.3 |
1EQ | 11/13/2021 4:02 | 11/13/2021 6:00 | Running | 11/12/2021 | 2.0 |
2EQ | 11/12/2021 6:00 | 11/13/2021 4:02 | Running | 11/12/2021 | 22.0 |
2EQ | 11/13/2021 4:02 | 11/13/2021 6:00 | IDLE | 11/12/2021 | 2.0 |
2EQ | 11/17/2021 6:00 | 11/17/2021 9:23 | IDLE | 11/17/2021 | 3.4 |
2EQ | 11/17/2021 9:23 | 11/17/2021 12:12 | In Setup | 11/17/2021 | 2.8 |
2EQ | 11/17/2021 12:12 | 11/18/2021 6:00 | Running | 11/17/2021 | 17.8 |
The table should look like below.
MachineID | StartDate | EndDate | Status | Data_Date | Duration Hrs |
1EQ | 11/12/2021 6:00 | 11/12/2021 11:30 | Running | 11/12/2021 | 5.5 |
1EQ | 11/12/2021 11:30 | 11/12/2021 13:10 | In Setup | 11/12/2021 | 1.7 |
1EQ | 11/12/2021 13:10 | 11/12/2021 23:41 | Running | 11/12/2021 | 10.5 |
1EQ | 11/12/2021 23:41 | 11/13/2021 4:02 | IDLE | 11/12/2021 | 4.3 |
1EQ | 11/13/2021 4:02 | 11/13/2021 6:00 | Running | 11/12/2021 | 2.0 |
2EQ | 11/12/2021 6:00 | 11/13/2021 4:02 | Running | 11/12/2021 | 22.0 |
2EQ | 11/13/2021 4:02 | 11/13/2021 6:00 | IDLE | 11/12/2021 | 2.0 |
2EQ | 11/13/2021 6:00 | 11/14/2021 6:00 | IDLE | 11/13/2021 | 24.0 |
2EQ | 11/14/2021 6:00 | 11/15/2021 6:00 | IDLE | 11/14/2021 | 24.0 |
2EQ | 11/15/2021 6:00 | 11/16/2021 6:00 | IDLE | 11/15/2021 | 24.0 |
2EQ | 11/16/2021 6:00 | 11/17/2021 6:00 | IDLE | 11/16/2021 | 24.0 |
2EQ | 11/17/2021 6:00 | 11/17/2021 9:23 | IDLE | 11/17/2021 | 3.4 |
2EQ | 11/17/2021 9:23 | 11/17/2021 12:12 | In Setup | 11/17/2021 | 2.8 |
2EQ | 11/17/2021 12:12 | 11/18/2021 6:00 | Running | 11/17/2021 | 17.8 |