in my Table attendance
Insert Into tblAttendance(cEmpID,cCode,dDate,notMin) Values
('1000','R' , 120,'2016-10-27'),
('1000','R' , 120,'2016-10-28'),
('1000','S' , 120,'2016-10-29'),
('1000','L' , 120,'2016-10-30'),
('1001','R' , 120,'2016-10-27'),
('1001','R' , 120,'2016-10-28'),
('1001','S' , 120,'2016-10-29'),
('1001','L' , 120,'2016-10-30')
i need to sum all OT Min. per Code the output something like this.. EmpID,R-Total,S-Total,L-Total
here's my Sample Query
Select (Select sum(nOTMin) from tblattenddetail Where cCode='R') 'R-Total',
(Select sum(nOTMin) from tblattenddetail Where cCode='S') 'S-Total',
(Select sum(nOTMin) from tblattenddetail Where cCode='L') 'L-Total'
i need to Include the cEmpID.. Please Help me how will i revise this to Include the cEmpID..