I have a dataset in the below format which has Intime, Outime, the Begin time of a working day and the End time of working day.
I have to calculate the difference between intime and outtime in hours (Time_taken) but the difference has to be on the basis of the BOD and EOD.
Ex: In the second case you can see that time taken is 10 hours in the first day and 8 hours in the second day. hence total time taken is 18 hours.
If somebody has worked on something like this then kindly help.
FORMAT DIFERENCE TIME5.;
DO DAY=DATEPART(INTIME) TO DATEPART(OUTTIME);
IF DAY=DATEPART(INTIME) THEN DIFERENCE=0;
IF DAY=DATEPART(OUTTIME) THEN OUTPUT;