Picking up Variables in SQL Text?

edited November 2006 in FastReport 4.0
I have a frxDBXQuery object with SQL text in it. I want to pass the contents of a variable I've created to it (this contains a date).

The variable can be used else where without any problem but when running the report it says the variable doesn't have a value.

I'm using the syntax:
...
COUNT(CASE WHEN DateOpened >= :StartDate THEN 1 END)
...

The variable is set in Delphi with:

frxReport1.Variables := StartDate;

Is this wrong or is it not possible to pass variables in this way?

If not I guess you'd have to set the SQL string in code somewhere. Perhaps when the report starts?

Thanks for any help...

Mark

Comments

  • edited 3:48PM
    You should go query.Params editor and set up your parameter. Look at "internal datasets/Internal query" report in the frdemo.
  • edited 3:48PM
    Thanks!

    I didn't spot that in the manual (I'm using the Studio V3 manuals at present) but it was under my nose all along!

    Mark

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.