Check this
--Dummy table
declare @tbl Table(AttendanceId int, EmpId int,CheckTime datetime, CheckType int)
--Insert data in Dummy table
insert into @tbl
select 3, 5,'2013-01-03 09:00:15.000',1 union all
select 4, 5,'2013-01-03 11:00:00.000',2 union all
select 5, 5,'2013-01-03 11:30:00.000',1 union all
select 6, 5,'2013-01-03 13:00:00.000',2 union all
select 7, 5,'2013-01-03 13:30:00.000',1 union all
select 8, 5,'2013-01-03 16:00:00.000',2 union all
select 9, 5,'2013-01-03 16:30:00.000',1 union all
select 10,5,'2013-01-03 18:00:00.000',2
select sum([diff]) from
(
select
cast((DateDiff(minute, CheckTime, (select CheckTime from @tbl where AttendanceId = t.AttendanceId + 1 and EmpId = t.EmpId)) / 60.0) as decimal(10,2)) as [Diff]
from @tbl t where CheckType = 1 and EmpId = 5
) as tmp