July 16, 2009 at 4:04 am
Thanks a ton Scott...
Missed pasting the complete code...
Below is the complete code
update Attendance
set workedhours =
--convert(decimal(10,2),REPLACE(CONVERT(char(5),es_sign_out - es_sign_in,8),':','.'))
convert(decimal(10,2),(rtrim(convert(char(5),datediff(ss,sign_in,sign_out) / 3600 )) + '.' +
rtrim(convert(char(5),(datediff(ss,sign_in,sign_out) % 3600) / 60)) ))
The answer for your question is "I wanted to find the difference (between signout & signin) to be expressed in hh.mm" (in its simple form I could express).
Please find the below data (how hard people are working).
EmpNo AttendanceDate SignInTime SignoutTime WrkdHrs
12102009-04-02 00:00:00.0002009-04-02 09:23:00.0002009-04-03 20:18:00.00034.55
12102009-04-03 00:00:00.0002009-04-03 08:35:00.0002009-04-03 20:18:00.00011.43
12102009-04-06 00:00:00.0002009-04-06 09:09:00.0002009-04-06 21:49:00.00012.40
12102009-04-07 00:00:00.0002009-04-07 08:55:00.0002009-04-07 21:35:00.00012.40
Now did I make my things clear on the requirement?
July 19, 2009 at 7:47 pm
So, Arunkumar ... does that mean you actually have an answer to your problem or are you just posting another bit of problem code.
I know that you think what you asked was clear but it obviously wasn't clear at all especially since you used a non-standard notation for hours and minutes. Before you post another problem, I suggest you study the first link in my signature below. This thread would have only been two posts long if you had followed those simple rules for posting data and results expected. The method even makes up for huge "language barrier" problems.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply