そのようなことを試してください:
select *, DATEDIFF(minute, (
select max(b.TimeOut)
from TIMESHEET as b where a.EmpID=b.EmpID and b.ROW<a.ROW
), a.TimeIn
) as diff
from TIMESHEET as a
そのようなことを試してください:
select *, DATEDIFF(minute, (
select max(b.TimeOut)
from TIMESHEET as b where a.EmpID=b.EmpID and b.ROW<a.ROW
), a.TimeIn
) as diff
from TIMESHEET as a