TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
yesubabu k
1.1k
644
63.4k
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)
Reply
Answers (
1
)
Date sorting issue in sql server
weekly base shift change