update t1
set t1.totalHrsWorked=cast(DATEDIFF(MINUTE , t2.startDate, t2.endDate) *0.0166667 AS decimal(10,2))
from Table1 t1
inner join Table2 t2
on t1.Id = t2.Id
where t1.Id between 1 and 100
Recollect Basic Things
update t1
set t1.totalHrsWorked=cast(DATEDIFF(MINUTE , t2.startDate, t2.endDate) *0.0166667 AS decimal(10,2))
from Table1 t1
inner join Table2 t2
on t1.Id = t2.Id
where t1.Id between 1 and 100
Leave a Reply