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
| SELECT adm.oid
, TEA.FORMAT_TOOLS.LongToTime(adm.date_ligne_commande)
, admc.entite_operationnelle_ope
, adm.donneur_ordre
, adm.vehicule
, adm.prestation
, adm.detail_ligne_contrat
, adm.trp_site_enlevement
, adm.trp_site_livraison
, admc.numero_commande
, admc.libelle
, adm.commande
, adm.total_ht
, enu.libelle_lng
, ( COUNT(*)
FROM ADM_COMMANDEC_LIGNE AS cnt
WHERE adm.commande = cnt.commande
) as NB_VEH_COMMANDE_CL_QT
FROM
ADM_COMMANDEC_LIGNE AS adm
INNER JOIN
ENU_STATUT_ADM_PRST AS enu
ON enu.oid = adm.statut_admin
INNER JOIN
ADM_COMMANDE_CLIENT AS admc
ON admc.commande = adm.commande (???)
WHERE
adm.date_ligne_commande BETWEEN TEA.FORMAT_TOOLS.TimeToLong(:l_date_min) AND TEA.FORMAT_TOOLS.TimeToLong(:l_date_max)
; |
Partager