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
| select a.lib_cach, b.daterecep, c.lib_norme, i.raison_fou, d.lib_tr,
(h.no_group) as nolot,
sum((h.nbsacevac*h.poidbrut)/h.nbsac) as poidbr_in,
(e.nbsacs) as bag_in,
sum((h.nbsacevac*h.poidnetp)/h.nbsac) as poidfou_in,
sum((h.nbsacevac*h.poidnet)/h.nbsac) as poidnet_in,
(e.poidplein) as poidbr_st,
(b.nbsac1) as bag_out,
(e.poidnet) as poidnet_st,
(e.ecartpoid) as freinte,
((e.ecartpoid/sum((h.nbsacevac*h.poidnet)/h.nbsac))*100) as freinte_pr,
(b.prixbrut) as prix_usin,
00000 as stor_exlos,
000000 as stor_exval,
b.poidnet,
b.poidbrut,
0000 as trsp_exc,
(b.poidbrut-b.poidnet-e.nbsacs) as fact_disc,
00000000 as recov_val,
(b.poidbrut-g.poidplein) as trsp_wlos,
(((b.poidbrut-g.poidplein)/g.poidplein)*100) as trsp_wpr " & _
from table1 a, table b, table3 c, table4 d, table5 e, table6 f, table7 g, table8 h, table9 i where a.cod_cach=b.cod_cach
and b.cod_tr=d.cod_tr
and b.cod_norme=c.cod_norme
and b.nobl_int=e.nobl_int
and e.nobl_int=f.nobl_int
and f.nolot=g.no_group
and g.no_group=h.no_group
and b.cod_fou=i.cod_fou
and b.cod_prod= w.vcod_prod.Trim &
and b.cod_mag>=w.vmagasi1.Trim
and b.cod_mag<=w.vmagasi2.Trim
and b.cod_exp>= w.vexportat1.Trim
and b.cod_exp<= w.vexportat2.Trim
and b.type_lot=1
and b.daterecep>= w.vdate1
and b.daterecep<= w.vdate2
group by a.lib_cach, b.daterecep, c.lib_norme, i.raison_fou, d.lib_tr, h.no_group,
e.nbsacs, e.poidplein, b.nbsac,e.poidnet, e.ecartpoid, b.prixbrut, 0000, 00000,
b.poidnet, b.poicbrut, 0000, (b.poidbrut-b.poidnet-e.nbsac), 00000000,
(b.poidbrut-g.poidplein), (((b.poidbrut-g.poidplein)/g.poidplein)*100)
order by b.daterecep |
Partager