|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello,
I have the table "EmployeesTimeWork" with the structure: IdEmployee Date TimeIn TimeOut ------------------------- --------- ------------------ In other I have the 1 day ranges from the hours like 5-6,6-7,...12-13,..23:0,..to 4-5 I have sumarizing the total hours works by range but I'm not find the solution. The most complex situation-case is when the employe work start at 23hour (example) and to finally at 3:00 (example) Also I work with sql server 2005 A lot of thanks in advance and sorry for my english |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
sqlTest
A few days ago a SQL Server MVP Steve Kass has posted simple script to get a difference between two days In your case , construct Date+TimeIN and Date +TimeOUT and compare by using Steve's script WITH Secs(s) AS ( SELECT DATEDIFF(second, '2008-06-07T21:30:05', 2008-06-08T02:33:15') ----Add here from your table..... ) SELECT RIGHT(s/3600,6) + ':' + RIGHT(100+s%3600/60,2) + ':' + RIGHT(100+s%60,2) FROM Secs; "sqlTest" <software@icg.es> wrote in message news:daf22cde-f8c3-4787-a649-16ff1075c68f@x35g2000hsb.googlegroups.com... > Hello, > I have the table "EmployeesTimeWork" with the structure: > > IdEmployee Date TimeIn TimeOut > ------------------------- --------- ------------------ > > In other I have the 1 day ranges from the hours like > 5-6,6-7,...12-13,..23:0,..to 4-5 > > I have sumarizing the total hours works by range but I'm not find the > solution. > The most complex situation-case is when the employe work start at > 23hour (example) and > to finally at 3:00 (example) > > Also I work with sql server 2005 > > A lot of thanks in advance and sorry for my english |
|
![]() |
| Outils de la discussion | |
|
|