Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Using TODAY or NOW functions

edited April 2006 in End User
Chaps

How do I use these Interbase functions from within the End User report
Solution...

I want to do a where clause ,,eg where date < Today

Thanks

mark

Comments

  • edited April 2006

    The Query Designer does not allow a function to be specified in the SQL
    where clause.
    The TdaSQLBuilder class can be used to programmatically modify the SQL in
    the same manner as the query designer. For example you can use it add/modify
    search criteria. Therefore you can use Delphi code or RAP code to modify the
    search criteria to include the current date.

    See the TdaSQLBuilder topic in the online help and from there traverse to
    the subtopics for search criteria - there is example code in the help.



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2006
    Nard

    Thanks for that...

    Can you send me an example RTM file that shows how to do just this in RAP ??

    I have an End User Report Solution already used globally and would rather
    issue an RTM then a new EXE.

    Cheers

    Mark

  • edited April 2006

    Here is an example that I created in RAP code. I used the
    Report.BeforeOpenDataPipelines event. This example works in paradox.
    Depending upon what database engine you are using, you might need to format
    the date string differently.


    var
    lSQLBuilder: TdaSQLBuilder;
    begin

    lSQLBuilder := TdaSQLBuilder.Create(Customer);

    lSQLBuilder.SearchCriteria.Add('Customer', 'LastInvoiceDate', '=',
    DateToStr(CurrentDate));

    lSQLBuilder.Free;

    end;



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2006
    Nard


    Thanks for that, however I do not seem to have that event
    "BeforeOpenDataPipelines"

    I should point out that I am currently using version 7.04

    Cheers

    Mark


  • edited April 2006

    For RB 9 we introduced two new events: Report.OnInitializeParameters and
    Report.BeforeOpenDataPipelines and the new TdaSQLBuilder class. The goal was
    to enable RAP code to be used to create/initialize parameters (including
    AutoSearch parameters) and to use RAP code to modify the SQL associated with
    a dataview.

    RB 7 does not include the ability to do what you describe. You might
    consider updating to RB 10, if at all possible.




    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2006
    Is RB10 supported by Delphi 7 ????




  • edited April 2006

    Yes.

    RB 10 includes support for D6, D7, D2005, and D2006




    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.