PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > Find employee work hours in time range
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Find employee work hours in time range

Réponse
 
LinkBack Outils de la discussion
Vieux 17/07/2008, 12h50   #1
sqlTest
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Find employee work hours in time range

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
  Réponse avec citation
Vieux 17/07/2008, 13h22   #2
Uri Dimant
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Find employee work hours in time range

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



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h49.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07765 seconds with 10 queries