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

About RAP and parameters

edited July 2009 in General
Hello Folks,

I'm testing the usage of parameters with direct sql in enduser reports.

In my test I'm using
select * from customers where code >= :param1 and code <= :param2

this works correctly.

But one question.

I want to use between params.

Is there anything to do something like this:

1st. Create a between param
2nd. In the query editor write sql code like this:

select * from customers where code between :param1.value1 and
:param1.value2

Regards,

Francis

Comments

  • edited July 2009
    Hi Francisco,

    When using between parameters you can use two parameters like you have below
    or you can use a single autosearch parameter with a search expression
    separated by a comma (defining each value). Then you can access each value
    using the TppParameter.Values[] property.

    select * from customers where code between :param1.values[0] and
    :param1.values[1]

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2009
    Sorry Nico, But I'm not too fast today.

    I can't find documentation about this, I'm coming from Version 7 where there
    isn't parameters which I think is a very good feature.

    Are you meaning that if I have a parameter called 'timeperiod' like this
    datatype dtDateTime
    enabled true
    SearchExpression 1/1/2009-2/1/2009
    SearchOperator soBetween

    Then I can go to the SQLEditor and write

    Select * from bookings
    where bookings.bookingdate between :timeperiod.values[0] and
    :timeperiod.values[1]

    In the perfect world, this could be fantastic.

    Regards

    Francis


  • edited July 2009
    Hi Francisco,

    If you are editing the SQL in DADE, there is no need to define each value.
    DADE will construct the expression itself based on how many values are
    present in the parameter.

    Select * from bookings
    where bookings.bookingdate between :timeperiod


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2009
    Thank You Nico. Very usefull.

This discussion has been closed.