bonjour,
Voila j'ai un trou, est il possible de rajouter a la premiere requete la somme des jours trouvé dans la deuxieme requête
pour avoir comme resultat un tableau avec les en tetes suivantes :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
27
28
29
30
31
32
33 -- premiere requête ----------------------------------------------------- select Agence, sum(case [Type Article] when '1' then cast([Forecast Quantity (Base)] as float) else 0 end )as Poules, sum(case [Type Article] when '2' then cast([Forecast Quantity (Base)] as float) else 0 end )as canard, sum(case [Type Article] when '1' then cast([Forecast Quantity (Base)] as float) when '2' then cast([Forecast Quantity (Base)] as float) else 0 end )as PouletCana sum(case [Type Article] when '4' then cast([Forecast Quantity (Base)] as float) else 0 end )as Oie, sum(case [Type Article] when '5' then cast([Forecast Quantity (Base)] as float) else 0 end )as Dindes, sum(case [Type Article] when '6' then cast([Forecast Quantity (Base)] as float) else 0 end )as boeuf, sum(case [Type Article] when '1' then cast([Forecast Quantity (Base)] as float) when '2' then cast([Forecast Quantity (Base)] as float) when '4' then cast([Forecast Quantity (Base)] as float) when '5' then cast([Forecast Quantity (Base)] as float) when '6' then cast([Forecast Quantity (Base)] as float) else 0 end )as UnitBase from dbo.[BASE$Production] where [Forecast Date] between '01/06/09' and '30/06/09' group by Agence order by Agence -- deuxieme requête ------------------------------------------------------ select Agence, max(cast([Forecast Quantity (Base)]as float)) as Jours from dbo.[BASE$Production] where [Forecast Date] between '01/05/09' and '31/05/09' and No_ = 'F1' group by Agence,Equipe,[Document No_],[Forecast Date] order by Agence
merci de votre aide<------------ 1er requete ----------------------------------------------><--2 ieme requete ->
Agence - Poules - canard - PouletCana - Oie - Dindes - boeuf - UnitBase - Jours
valeur - valeur - valeur - valeur - valeur - valeur - valeur - valeur - valeur
Partager