Create a query in run time

Hi all,

I need to create a report in run time with a parameters introduced by the user in the dialog page. I dont??t know passing these parameters to query, the report show me the next error:

'Incorrect arguments, outside the allowed interval or in conflict with others.'

I put the code to see if can you help me

ADOQuery1.Sql.Clear;
ADOQuery1.Sql.Add('SELECT v.TipoFijo, (select t.Descripcion from TipoCartera t where t.CodCartera = v.xCodCartera) AS DesCartera, ');
ADOQuery1.Sql.Add (' v.CodReceptor, v.Contador, v.NumFactura, v.Plazo, v.FechaDoc, v.FechaVto, ');
ADOQuery1.Sql.Add (' v.Importe, v.ImpGastos, v.Situacion, v.FechaCobro, v.Contabilizado ');
ADOQuery1.Sql.Add (' FROM VENCIMIENTOS v ');
ADOQuery1.Sql.Add (' WHERE (v.NumFactura = :DocDesde) ');

ADOQuery1.ParamByName('DocDesde').Value := edDocDesde.Text;

Thank you very much!!!!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.