Modérateurs: Super Modérateur, Modérateurs


select Z1 AS Fourn_Nom,
Z2 AS Article_Designation,
Z3 AS Article_Code,
Z4 AS Date_Liv,
SUM(Z11) AS Comm_Qte,
SUM(Z12) AS Acha_Qte
FROM
(
select min(CT_Intitule) AS Z1,
min(AR_Design) AS Z2,
F_DOCLIGNE.ar_ref AS Z3,
CASE
WHEN Do_DateLivr < getdate() THEN getdate()
ELSE Do_DateLivr
END AS Z4,
SUM(DL_Qte) * -1 AS Z11,
0 AS Z12
from F_DOCLIGNE, F_ARTICLE,
F_ARTFOURNISS, F_COMPTET
where ( DO_Domaine = 0 and DO_Type = 1 )
and ( F_DOCLIGNE.DE_No = 15 )
and F_DOCLIGNE.ar_ref = F_ARTICLE.ar_ref
and ( F_ARTICLE.AR_Ref = F_ARTFOURNISS.ar_ref and AF_Principal = 1 )
and F_ARTFOURNISS.CT_Num = f_COMPTET.CT_Num
group by f_docligne.ar_ref, do_datelivr
UNION
select min(CT_Intitule) AS Z1,
min(AR_Design) AS Z2,
F_DOCLIGNE.ar_ref AS Z3,
CASE
WHEN Do_DateLivr < getdate() THEN getdate()
ELSE Do_DateLivr
END AS Z4,
0 AS Z11,
SUM(DL_Qte) AS Z12
from F_DOCLIGNE, F_ARTICLE,
F_ARTFOURNISS, F_COMPTET
where ( DO_Domaine = 1 and DO_Type = 12 )
and ( F_DOCLIGNE.DE_No = 15 )
and F_DOCLIGNE.ar_ref = F_ARTICLE.ar_ref
and ( F_ARTICLE.AR_Ref = F_ARTFOURNISS.ar_ref and AF_Principal = 1 )
and F_ARTFOURNISS.CT_Num = f_COMPTET.CT_Num
group by f_docligne.ar_ref, do_datelivr
)
REQ1
GROUP BY Z1, Z2, Z3, Z4
ORDER BY Z1, Z2, Z3, Z4







rcanudo a écrit:J'ai déjà essayé le hic c'est que je n' ai pas accÚs à la zone .........




rcanudo a écrit:Je ne peux mettre en information que les zones du Script SQL



rcanudo a écrit:Ma liste comporte des articles qui ne sont pas concernés dans "ma" logique ( Articles non commandés, Fournisseur
sans article )
=Non EstNul(<Qté Commandes Fournisseur>)

rcanudo a écrit:Cela marche au niveau du tableau ........ le plus rigolo est quand je rajoute une rupture par fournisseur, j' ai bien
une rupture par fournisseur mĂȘme pour ceux qui n' ont pas d' article concernĂ© !!!!!!!!
= EstNul(<Acha_Qte>) Et EstNul(<Comm_Qte>)

=(EstNul(<Qté Commandes Client>) Ou <Qté Commandes Client>=0) Et (EstNul(<Qté Commandes Fournisseur>) Ou <Qté Commandes Fournisseur>=0)


Retourner vers Sage Editions Pilotées
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 0 invités