Error adding more than 1 searchcriteria in TdaSQLBuilder
Hello,
In a report which has two queries, the main query has one searchcriteria
and I use this code in the report design to copy the searchcriteria to
the second query:
procedure ReportBeforeOpenDataPipelines;
var
lb : TdaSQLBuilder;
begin
lb := TdaSQLBuilder.Create(v_patient_procedure_summary);
lb.SearchCriteria.Add('v_patient_procedure_summary',
'proceduredate', 'Between', report.autosearchfields[0].searchexpression);
lb.free;
end;
and the report gives the expected result.
However, if I add another searchcriteria to the first query and modify
the code above thus:
procedure ReportBeforeOpenDataPipelines;
var
lb : TdaSQLBuilder;
begin
lb := TdaSQLBuilder.Create(v_patient_procedure_summary);
lb.SearchCriteria.Add('v_patient_procedure_summary',
'proceduredate', 'Between', report.autosearchfields[0].searchexpression);
lb.SearchCriteria.Add('v_patient_procedure_summary', 'siteid', '=',
report.autosearchfields[1].searchexpression);
lb.free;
end;
I get the error : Incorrect syntax near ')'
Can you help please?
Thanks,
Arthur
In a report which has two queries, the main query has one searchcriteria
and I use this code in the report design to copy the searchcriteria to
the second query:
procedure ReportBeforeOpenDataPipelines;
var
lb : TdaSQLBuilder;
begin
lb := TdaSQLBuilder.Create(v_patient_procedure_summary);
lb.SearchCriteria.Add('v_patient_procedure_summary',
'proceduredate', 'Between', report.autosearchfields[0].searchexpression);
lb.free;
end;
and the report gives the expected result.
However, if I add another searchcriteria to the first query and modify
the code above thus:
procedure ReportBeforeOpenDataPipelines;
var
lb : TdaSQLBuilder;
begin
lb := TdaSQLBuilder.Create(v_patient_procedure_summary);
lb.SearchCriteria.Add('v_patient_procedure_summary',
'proceduredate', 'Between', report.autosearchfields[0].searchexpression);
lb.SearchCriteria.Add('v_patient_procedure_summary', 'siteid', '=',
report.autosearchfields[1].searchexpression);
lb.free;
end;
I get the error : Incorrect syntax near ')'
Can you help please?
Thanks,
Arthur
This discussion has been closed.
Comments
Which version of ReportBuilder and Delphi are you using? Also which DB
and connectivity are you currently using?
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Profuse apologies.
This is older application which needs a report modified.
RB 9.02 and D2005
Arthur
You are using a very old version of ReportBuilder and Delphi.
In my testing with the latest version of both, and RAP code very similar
to yours, everything compiled and functioned correctly. It's possible,
this was a bug that was fixed for a later version.
Please consider upgrading your development tools regularly to take
advantage of new features as well as timely fixes.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com