Passing Params to an Query at runtime

Hi,

I have a report which wher the underlying sql is added depending on options choosen from the dialog screen at runtime. The sql is set via sql.add statements.

On one of these options however i need to pass a paramater value to the sql. The paramater will take it's value from a dateEdit control on the dialog form.

I can't figure out how to pass this paramater to the sql statement. I know it has something to do with params.add

Any help would be much appreciated.

sql.add('Select * from "c:\Computech\Mailshot V2\Data\Mailshot.dat" where Tracking=True and PubDate > :PDate Order by FollowUpDate ASC, Plan_Ref');
;)


Comments

  • edited 8:26AM
    U set a variable like that:
    wrote:
    [Test]
    And u put the value like that in the event OnClick by exemple:
    wrote:
    begin
      Test := [Qry."CName"]
    end
    ;)

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.