Problem with parameters in Discoverer [message #151955] |
Tue, 20 December 2005 01:14 |
d_indrani
Messages: 8 Registered: November 2005 Location: Bangalore, India
|
Junior Member |
|
|
Hi friends,
I am building a report using Oracle Discoverer .I have a problem to set condition using two date parameters.
CASE 1:
-------
I have one date parameters, for example
1> From_DATE
Requirement: report should run for a date period between :FROM_DATE and :FROM_DATE+7
So I have created one condition saying
Report_date between :FROM_DATE and :FROM_DATE+7
But if I press 'OK' then it says invalid type used in Condition.
HOW DO I HANDLE THIS SITUATION?
CASE 2:
-------
I have two date parameters, for example
1> FROM_DATE
2> TO_DATE
I need to validate TO_DATE like below-->
1>IF :TO_DATE - :FROM_DATE > 7 then
it should take :FROM_DATE + 7
Can anyone help me out in this.
Please reply as soon as possible.
Thanks
Indrani
|
|
|
Re: Problem with parameters in Discoverer [message #153006 is a reply to message #151955] |
Wed, 28 December 2005 06:10 |
skooman
Messages: 913 Registered: March 2005 Location: Netherlands
|
Senior Member |
|
|
Indrani,
I looks as if the parameter you created is not in a date format (it only is, if you created it during the creation of a condition on a date field).
If that's the case, then alter your condition to:
Report_date between to_date(:FROM_DATE) and to_date(:FROM_DATE)+7
As for the second question: you can't change the value of a parameter, once the user has entered a value.
However, if you want to use it in a condition, you can create the condition like:
report_date between to_date(:from_date) and (case when (:TO_DATE - :FROM_DATE) > 7 then to_date(:FROM_DATE)+7 else to_date(:to_date) end)
Regards,
Sabine
|
|
|