1 2 3 4 5 6 7 8 9 10 11 12 13 14
| procedure TApercu_Notes.ButtonOKClick(Sender: TObject);
begin
Note.Query_Note.sql.Clear;
Note.Query_Note.sql.Add('Select Mat, Cod_Classe, CodeMat, LibMat, Coeff, Trimestre, cast(sum(Note) as numeric(10,2)) as Total, cast(Sum(Note)/3 as numeric(10,2)) as Moy, cast(Sum(Note)/3*Coeff as numeric(10,2)) as Ponderer,');
Note.Query_Note.sql.Add('count(Mat)* cast(sum(Note)/3 as numeric(10,2)) as Moy_Classe from Note, Matiere, Eleve');
Note.Query_Note.sql.Add('where Note.CodeMat = Matiere.CodeMat');
Note.Query_Note.sql.Add('And Eleve.Mat = Note.Mat');
Note.Query_Note.sql.Add('And Eleve.Cod_Classe = Note.Cod_Classe');
Note.Query_Note.sql.Add('And Cod_Classe = '+ QuotedStr(ClasseEdit.text));
Note.Query_Note.sql.Add('And Trimestre = '+ QuotedStr(PeriodeEdit.text));
Note.Query_Note.sql.Add('group by Mat, Cod_Classe, CodeMat, LibMat, Coeff, Trimestre');
Note.Query_Note.Open;
Note.QuickRepNote.Preview;
end; |
Partager