yesubabu k

yesubabu k

  • 1.4k
  • 564
  • 26.1k

OT Calculation based on

Feb 15 2018 4:25 AM
how to calculate OT?
please help me
 
 
ex:
 
declare @OT_Hours varchar(44)--decimal(18,1)
declare @WorkHours varchar(44)--decimal(18,2)
declare @ActualHours varchar(44)--decimal(18,2)
select @WorkHours=
right('0'+ cast( cast((WorkMin/60) as int) as varchar(44)),2)+ ':'+ right('0'+ cast(cast(WorkMin as int)-
(cast((WorkMin/60) as int)*60) as varchar(44)),2) from Attendance_Master
where left(convert(char(6), AM_date,112),6) =
left(convert(char(8),@date,112),6) and AM_EmpCode=@emp_code and (AM_Status='O' OR AM_Status='P')
set @ActualHours='08:00'
set @OT_Hours=(@WorkHours-@ActualHours)
 

Brought to you by:

Answers (1)