Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.
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;
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
mlmcc