Bonjour,
Dans une procédure j'ai une requette qui calcul un temps d'arret[Temps].

Mon problème est que je n'arrive pas a creer un champ dans lequel les valeurs [temps] s'additionnent.

A la limite, je n'ai besoin que du résultat final qui pourrait etre recopier sur chaque ligne.

voici le code de ma Ps:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 
SELECT     Tbl_Taches.Compte_Machine, Tbl_Affectation_machine.Machine, Tbl_Taches.Tache, Tbl_Taches.Type_Intervention, Tbl_Taches.Code_Planif, CONVERT(varchar,Tbl_Taches.Fin_T - Tbl_Taches.Debut_T, 108) AS Debut_T, Tbl_Intervention.Generer_Arret AS arret, CONVERT(varchar,Tbl_Intervention.Date_Fin_Arret - Tbl_Intervention.Date_Debut_Arret, 108) AS temps, View_piece_utilise_par_tache.Prix_piece_utilise AS prix_piece,CONVERT(varchar, Tbl_Taches.Debut_T, 103) AS Date_Intervention
FROM         Tbl_Taches INNER JOIN
                      Tbl_Affectation_machine ON Tbl_Taches.Compte_Machine = Tbl_Affectation_machine.Compte_Machine INNER JOIN
                      Tbl_Selection_Type_5 ON Tbl_Taches.Debut_T >= Tbl_Selection_Type_5.du AND Tbl_Taches.Fin_T <= Tbl_Selection_Type_5.au INNER JOIN
                      Tbl_Intervention ON Tbl_Taches.Id = Tbl_Intervention.Numero_Tache LEFT OUTER JOIN
                      View_piece_utilise_par_tache ON Tbl_Intervention.Numero_Tache = View_piece_utilise_par_tache.Numero_tache
WHERE     (Tbl_Affectation_machine.Compte_Machine = @Compte_Niveau1) AND (Tbl_Taches.Realiser = 1)
ORDER BY Debut_T DESC
Quelqu'un aurait une idée ?

Merci d'avance