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
| WITH DBChart1.Series[0] DO
BEGIN
Clear;
DBChart1.Title.Text.Clear;
DBChart1.Title.Text.add('Titre');
WITH DataModule1.MyQLCC DO
BEGIN
SQL.Clear;
SQL.Add('SELECT DISTINCT ID_Engin_FK3,Nom_Pas_FK1,Periode_LCC,MOE_CostHour,');
SQL.Add('SUM((Periode_LCC*Nb_Km_Annuel/Pas_nominal)*(Duree_Operation*MOE_CostHour*Nb_MOE+Cout_Conso + Prix)) As Cout_Total,');
SQL.Add('SUM( (Periode_LCC*Nb_Km_Annuel/Pas_nominal)*(Duree_Operation*MOE_CostHour*Nb_MOE+Cout_Conso + Prix)/(Nb_KM_Annuel*Periode_LCC)) As Cout_au_KM');
SQL.Add('FROM Arbo A ');
SQL.Add(' INNER JOIN Param_LCC L ON L.ID_Engin_FK1 = A.ID_Engin_FK3 ');
SQL.Add(' INNER JOIN ID_M M ON M.Nom_Pas = A.Nom_Pas_FK1 ');
SQL.Add('WHERE '+ concatener + ' = ' + QuotedStr(SelectedModule)+'');
SQL.Add('AND Niveau_M <> 6');
SQL.Add('GROUP BY Pas_nominal,Nom_Pas_FK1,Periode_LCC,Nb_Km_Annuel,MOE_CostHour');
SQL.Add('ORDER BY Pas_nominal ASC;');
Open;
First;
WHILE NOT DataModule1.MyQLCC.eof DO
BEGIN
AddXY(FieldByName('Nom_Pas_FK1').AsString,FieldByName('Cout_Total').AsFloat);
Next;
END;
END;
END; |
Partager