Your question, your audience. Choose who sees your identityâ€”and your questionâ€”with question security.
procedure TReportsForm.FilterBtnClick(Sender: TObject);
begin
MainForm.Query.Close; Elder
MainForm.Query.SQL.Clear;
MainForm.Query.SQL.Text := 'SELECT sum(AdultMale), sum(AdultFemale), sum(ChildMale), sum(ChildFemale), sum(ElderMale), sum(ElderFemale), ' +
'sum(PermEx), sum(DecEx), sum(SurgEx), sum(TempFill), sum(AmalFill), sum(CompFill), sum(InstRCT), ' +
'sum(DecRCT), sum(PermRCT), sum(PerPerio), sum(ScallPerio), sum(LesionPerio), sum(OLAMS), ' +
'sum(OGAMS), sum(DresMS), sum(PARay), sum(OcclRay), sum(ExoRay), sum(FullSet), sum(PartialSet), ' +
'sum(SetRepair), sum(PMSet), sum(FixedCrown), sum(FixedBridge), sum(OHI), sum(FS), sum(FSO) ' +
'FROM Statistics WHERE TransDate BETWEEN :FromDate AND :ToDate';
MainForm.Query.Parameters.ParamByName('FromDate').Value := DateOf(FromDateEdit.Date);
MainForm.Query.Parameters.ParamByName('ToDate').Value := DateOf(ToDateEdit.Date); //DateUtils
MainForm.Query.Open;
MainForm.frxReport.ShowReport();
Close;
end;
...
'FROM Statistics WHERE TransDate BETWEEN :pFromDate AND :pToDate';
MainForm.Query.Parameters.ParamByName('pFromDate').Value := DateOf(FromDateEdit.Date);
MainForm.Query.Parameters.ParamByName('pToDate').Value := DateOf(ToDateEdit.Date); //DateUtils
MainForm.Query.Open;
procedure TReportsForm.FilterBtnClick(Sender: TObject);
begin
MainForm.Query.Close; Elder
MainForm.Query.SQL.Clear; //[Child-Male]
MainForm.Query.SQL.Text := 'SELECT sum(AdultMale), sum(AdultFemale), sum([Child-Male]), sum(ChildFemale), sum(ElderMale), sum(ElderFemale), ' +
'sum(PermEx), sum(DecEx), sum(SurgEx), sum(TempFill), sum(AmalFill), sum(CompFill), sum(InstRCT), ' +
'sum(DecRCT), sum(PermRCT), sum(PerPerio), sum(ScallPerio), sum(LesionPerio), sum(OLAMS), ' +
'sum(OGAMS), sum(DresMS), sum(PARay), sum(OcclRay), sum(ExoRay), sum(FullSet), sum(PartialSet), ' +
'sum(SetRepair), sum(PMSet), sum(FixedCrown), sum(FixedBridge), sum(OHI), sum(FS), sum(FSO) ' +
'FROM Statistics WHERE TransDate BETWEEN :FromDate AND :ToDate';
MainForm.Query.Parameters.ParamByName('FromDate').Value := DateOf(FromDateEdit.Date);
MainForm.Query.Parameters.ParamByName('ToDate').Value := DateOf(ToDateEdit.Date); //DateUtils
MainForm.Query.Open;
MainForm.frxReport.ShowReport();
Close;
end;
mlmcc