SQL 2008
I have 2 Time(7) fields, Stime and Etime, I need a computed column (Hours) that calculates the difference between those 2 fields, only hours and minutes. Thank you
Technology Tips and News
SQL 2008
I have 2 Time(7) fields, Stime and Etime, I need a computed column (Hours) that calculates the difference between those 2 fields, only hours and minutes. Thank you
create table test (Stime Time(7), Etime Time(7), DiffInMinutes as datediff(minute,Stime ,Etime) ) insert into test values ('10:35:45.3370000', cast(getdate() as time(7))) select * from test drop table test
Hello!
declare @tab table ( Stime time, Etime time, CumputedColumn as CONVERT(char(5), DATEADD(MINUTE, datediff(minute, stime, etime), ''), 114) ) insert into @tab values ('05:10:30', '08:23:45') select * from @tab