How to sum the time columns in sql server
I want to sum the monday, tuesday,wednesday, thursday,friday and saturday timings and update into Tot_hrs I have update logic I am unable to sum the hrs from Monday to Satday
CREATE TABLE WEEKLY_ATTN(
[SYSID] [int] IDENTITY(1,1) NOT NULL,
[EMPLOYEE_SYSID] [int] NULL,
[Mon_day] [varchar](10) NULL,
[Tue_day] [varchar](10) NULL,
[Wed_day] [varchar](10) NULL,
[Thu_day] [varchar](10) NULL,
[Fri_day] [varchar](10) NULL,
[Sat_day] [varchar](10) NULL,
[Tot_Hrs] [varchar](20) NULL
);
INSERT INTO WEEKLY_ATTN (employee_sysid,mon_day,tue_day,wed_day,thu_day,fri_day,sat_day)
values(41,'11:01','11:57','11:02','10:19','09:26',null);
Below is the query which I have used
select mon_day,Tue_day,wed_day,thu_day,fri_Day,sat_day,
cast(dateadd(s,
isnull(datediff(s, 0, mon_day), 0)+
isnull(datediff(s, 0, Tue_day), 0)+
isnull(datediff(s, 0, wed_day), 0)+
isnull(datediff(s, 0, Thu_day), 0)+
isnull(datediff(s, 0, fri_day), 0)+
isnull(datediff(s, 0, sat_day), 0)
,0) as time(0)) as Tot_hrs
from weekly_attn where employee_sysid=41;
mon_day Tue_day wed_day thu_day fri_Day sat_day tot_hrs
---------------------------------------------------------
11:01 11:57 11:02 10:19 09:26 NULL 05:45:00
however total hours is 53:45 hours can any one correct me where it is wrong. Any help?