Discoverer Parameters: Year to Date [message #216740] |
Tue, 30 January 2007 04:00 |
credgrave
Messages: 2 Registered: January 2007
|
Junior Member |
|
|
Hi guys,
At the moment im working on a database warehousing project. I'm using discoverer as a front end for a user friendly environment. Does anyone know how i can create a parameter to show the year to date? i need to put the following condition into the paramater:
FULL_DATE BETWEEN =add_months(sysdate,-12) AND =sysdate
However, as im sure you'll find, you cannot use the 'BETWEEN' function when using parameters - Ideally i'd like the user to be able to choose between two buttons, one showing all the data and one showing year to date. I would prefer to use a parameter to do this rather than the user adding/removing conditions from worksheet.
Thanks in advance,
Chris.
|
|
|
|
|
|
Re: Discoverer Parameters: Year to Date [message #217350 is a reply to message #216770] |
Thu, 01 February 2007 15:11 |
skooman
Messages: 913 Registered: March 2005 Location: Netherlands
|
Senior Member |
|
|
Hihi, can't resist answering this one of course...
You can create one condition with two parameters and a between comparison, like:
<item> BETWEEN <:p_1> AND <:p_2>
For :p_1 and :p_2 you can choose create new parameter twice, while creating the condition.
However, in the example you show us, I can't see where the parameter comes in. Or do you mean the parameter should be like Yes or No to limit the data to the last 12 months? Or do you want the parameter to give the number of months to select? Or...?
|
|
|
|
|
Re: Discoverer Parameters: Year to Date [message #222347 is a reply to message #216740] |
Sat, 03 March 2007 01:28 |
zafarkarachi
Messages: 29 Registered: November 2006 Location: Karachi Pakistan
|
Junior Member |
|
|
Try the better one for month to date and year to date
query.
select
trunc(to_date(sysdate,'dd-mon-yyyy'),'month') month_to_date,
trunc(to_date(sysdate,'dd-mon-yyyy'),'year') year_to_date
from dual
Zafar Iqbal
Karachi
|
|
|