Comment compter un nb de ligne?
Bonjour a tous,
Je souhaite compter un nombre de ligne de commande satisafaisant des conditions.
Je ne vois commment m'y prendre.
Voici ma requete:
select datepart(ww,CURRENT_TIMESTAMP)Semaines, NOMBRE DE LIGNE
datepart(yyyy,CURRENT_TIMESTAMP)Année,
CodeClient,
sum(DateDiff(day,DatePromisePlusTard,getdate())/7*5)"Nb Jours retards",
sum( ResteLivrer*PrixUnitEnDevise) "C.A à Expedier",
sum(MtHtRemiseEscomp) "Total"
from comc
WHERE
ResteExpedier='O' AND DateDiff(day,DatePromisePlusTard,getdate())>0
group by CodeClient