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 34 35 36 37 38 39 40 41 42 43 44
| --declare @matable TABLE(
--EQUIPE varchar(20),
--UNITBASE decimal(38,20),
--JOURS decimal(38,20))
--
--insert into @matable (
--EQUIPE,
--UNITBASE
--)
--select
--Equipe,
--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.[SOCIETE$Production Chantier]
--where [Forecast Date] between '01/01/2010' and '01/08/2010'
--group by Equipe
--order by Equipe
--
--insert into @matable(
--EQUIPE,
--jours)
--select
--Equipe,
--max(cast([Forecast Quantity (Base)]as float)) as Jours
--from dbo.[SOCIETE$Production Chantier]
--where [Forecast Date] between '01/01/2010' and '01/08/2010'
--and No_ = 'PR'
--and Ressource not like 'interimch%'
--and Ressource not like 'panne%'
--and [Document No_] not like 'AF.DEPOT.%'
--group by Equipe,[Document No_],[Forecast Date]
--order by Equipe
--
--select
--EQUIPE,
--max(cast(UNITBASE as float)) as UNITBASE,
--sum(cast(JOURS as float)) as JOURS
--from @matable
--group by Equipe |
Partager