Home » Developer & Programmer » Reports & Discoverer » Date Parameter Handling.
Date Parameter Handling. [message #123884] Wed, 15 June 2005 06:35 Go to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

I use NVL function with user parameters as follows (if user won’t pass any value, all values displayed):-
Where Tbl_A.Col_B = NVL(:P_1, Tbl_A.Col_B)

But it won’t workout for date fields.

To select range of date I have two user parameters for “min and max” date (P_X & P_Y) and use them as follows:-
Tbl_A.Date1 between :P_X and P_Y

Tell me how to embed NVL function to get the same goal in date parameters. i.e. if user wont select any date the P_X will be replace with min(Date1) and P_Y with max(Date1).

Wishes
Jawad


Re: Date Parameter Handling. [message #123896 is a reply to message #123884] Wed, 15 June 2005 08:31 Go to previous message
shrinaw
Messages: 2
Registered: June 2005
Junior Member
hi Jawad,
hope this may help u...
select a.* from emp a
where a.hiredate>(select nvl(:P_X,min(b.hiredate)) from emp b
where a.empno=b.empno)
and a.hiredate<(select nvl(:P_Y,max(c.hiredate)) from emp c
where a.empno=c.empno)

Rgds,
Shrinaw
Previous Topic: How to Pass a Select statement to a Report at Runtime
Next Topic: Reports Server 6i
Goto Forum:
  


Current Time: Thu May 16 22:24:12 CDT 2024