VING AVG (Ocenka)=3 OR AVG (Ocenka)=4 OR AVG (Ocenka)=5 ) ;. Parameters.ParamByName ( ff ). Value:=DateToStr ( DateTimePicker5.Date);.Parameters.ParamByName(laquo;llraquo;).Value:=DateToStr(DateTimePicker6.Date);.Open;ADOQuery2.RecordCountgt;0 then:=ADOQuery2.RecordCount:=0; .Close; .SQL.Clear; .SQL.Add ( Select AVG (Ocenka), Ocenka.id_student ) ;. SQL.Add ( From Ocenka ) ;. SQL.Add ( WHERE Data BETWEEN: ff AND: ll ) ;. SQL.Add ( GROUP BY id_student ) ;. SQL.Add ( HAVING (AVG (Ocenka)=4 OR AVG (Ocenka) =5) ) ;. Parameters.ParamByName ( ff ). Value:=DateToStr ( DateTimePicker5.Date);.Parameters.ParamByName(laquo;llraquo;).Value:=DateToStr(DateTimePicker6.Date);.Open;ADOQuery2.RecordCountgt;0 then:=ADOQuery2.RecordCount:=0; .Close; .SQL.Clear; .SQL.Add ( Select AVG (Ocenka), Ocenka.id_student ) ;. SQL.Add ( From Ocenka ) ;. SQL.Add ( WHERE Data BETWEEN: ff AND: ll ) ;. SQL.Add ( GROUP BY id_student ) ;. SQL.Add ( HAVING AVG (Ocenka)=5 ) ;. Parameters.ParamByName ( ff ). Value:=DateToStr ( DateTimePicker5.Date);.Parameters.ParamByName(laquo;llraquo;).Value:=DateToStr(DateTimePicker6.Date);.Open;ADOQuery2.RecordCountgt;0 then:=ADOQuery2.RecordCount:=0; .Close; .SQL.Clear; .SQL.Add ( Select AVG (Ocenka), Ocenka.id_student ) ;. SQL.Add ( From Ocenka ) ;. SQL.Add ( WHERE Data BETWEEN: ff AND: ll ) ;. SQL.Add ( GROUP BY id_student ) ;. Parameters.ParamByName ( ff ). Value:=DateToStr ( DateTimePicker5.Date);.Parameters.ParamByName(laquo;llraquo;).Value:=DateToStr(DateTimePicker6.Date);.Open;ADOQuery2.RecordCountgt;0 then:=ADOQuery2.RecordCount:=0; p gt; 0 then
ot:=(p * 100)/vsego; ch gt; 0 then:=(ch * 100)/vsego; tr gt; 0 then:=(tr * 100)/vsego; dva gt; 0 then:=(dva * 100) /vsego;.Variables [ pred ]:=QuotedStr ( Успішність у деканатеraquo;);.Variables[laquo;pyatraquo;]:=FloatToStr(ot);.Variables[laquo;chetraquo;]:=FloatToStr(xo);.Variables[laquo;triraquo;]:=FloatToStr(ud);.Variables[laquo;dvaraquo;]:=FloatToStr(pl);.PrepareReport;.ShowPreparedReport;;.
Форма Посади
Dolzh;
interface.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, .Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.DBCtrls , Vcl.Grids, .DBGrids;=class (TForm): TDBGrid ;: TDBNavigator; FormClose (Sender: TObject; var Action: TCloseAction);
{Private declarations}
{Public declarations}; var: TForm13;
{$ R * .dfm} Data, Main; TForm13.FormClose (Sender: TObject; var Action: TCloseAction) ;. Show ;; end.
Форма Дата
Data ;, Classes, DB, ADODB;=class (TDataModule): TADOConnection ;: TADOTable ;: TADOTable ;: TADOTable ;: TADOTable ;: TADOTable ;: TDataSource ;: TDataSource ;: TDataSource ;: TDataSource ;: TDataSource; _student: TIntegerField ;: TStringField ;: TStringField ;: TStringField; _r: TDateTimeField; _gruppi: TIntegerField ;: TStringField ;: TStringField; _zapisi: TIntegerField ;: TIntegerField; _student: TIntegerField; _predmeta: TIntegerField ;: TDateTimeField;:TStringField ;: TStringField; _predmeta: TAutoIncField ;: TStringField ;: TIntegerField ;: TADOTable ;: TADOTable ;: TDataSource ;: TDataSource ;: TADOTable ;: TDataSource ;: TIntegerField; _Prepod: TAutoIncField ;: TStringField ;: TStringField; _dolzhnost: TIntegerField ; _stepen: TIntegerField; _kafedri: TIntegerField ;: TStringField ;: TStringField ;: TStringField;
{Private declarations}
{Public declarations} ;: TDataModule1;
{$ R * .dfm}.