Having a problem finding a solution for the following issue:I have a table that includes the fields below:ID - INTMachine - TINYINTStartTime - DATETIMEEndTime - DATETIMEWhat I am trying to do is figure out how much time is used for production per day. The problem is, there are production runs that run over midnight and possible multiple days without ending. For example, if I have the following data:ID - 1 Machine - 2 StartTime - 2015-09-01 22:00:00.000EndTime - 2015-09-03 22:00:00.000So what I am looking for is taking the above record and turning it into 3 records like below:ID Machine StartTime EndTime1 2 2015-09-01 22:00:00.000 2015-09-01 23:59:59.9991 2 2015-09-02 00:00:00.000 2015-09-02 23:59:59.9991 2 2015-09-03 00:00:00.000 2015-09-03 22:00:00.000Does anyone have a way to do this?Thank you in advance,Bob
↧