1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
WITH TMP AS (
SELECT INWI.Date ,
Equipe_Cad.MatBCC,
INWI.Matricule_FS,
Equipe_Cad.Employe,
Equipe_Cad.Equipe,Equipe_Cad.Societe,
Projet.Projet,
INWI.Quantite,
RIGHT('0' + INWI.Tps_Net, 9) C
FROM INWI
INNER JOIN Equipe_Cad ON INWI.Matricule_FS=Equipe_Cad .MatFS
INNER JOIN Projet ON Projet.EtapeTraitement='INWI_PREPAID'
WHERE INWI.Date = '02/03/2018'
)
SELECT Date ,
MatBCC AS Matricule_BCC,
Matricule_FS,Employe AS Nom,Equipe,Societe,
Projet,
CAST(SUM(Quantite)AS int)AS Quantite ,
SUM(CAST(LEFT(C, 2) AS DECIMAL(10,8)) +
CAST(SUBSTRING(C, 4, 2) AS DECIMAL(10,8)) / 60 +
CAST(SUBSTRING(C, 7, 2) AS DECIMAL(10,8)) / 3600) AS Temps_Effectif
FROM TMP
GROUP BY Date, MatBCC ,Matricule_FS,Employe ,Equipe,Projet,Societe |
Partager