Page 1 of 1

Report Query

Posted: Fri May 05, 2006 2:52 am
by najm
Report query is
select *
from emp
where ((:p_losal is not null and :p_hisal is not null and sal between :p_losal and :p_hisal) or (:p_losal is null or :p_hisal is null)) /* by this between query if I am not entered any amount, report shows all the records and if I entered any value reports shows entered value records.

but when I use another parameter like this
and deptno =:p_eno /* and enter the deptno it show the records of the selected dept only. But I want when I am not entered any dept no in the parameter the reports must be run and shows all the records.

Najm

Posted: Fri May 05, 2006 3:30 am
by admin
The best option I would suggest is to use lexical references and build your where condition before report trigger.

Posted: Fri May 05, 2006 6:48 am
by mirza_rehan
You write this query....

select * from emp
where (sal between :p_losal and :p_hisal or (:p_losal is null or :p_hisal is null))
and (deptno =:p_Deptno or :p_deptNo is Null)

i think i will resolve you problem but still problem exist please reply or call me


Best regards,
R E H A N M I R Z A
System Analyst / Senior Oracle Developer
Cell: +92-304-2120807

When ever you pray
Please remember me and my family

Posted: Mon May 08, 2006 5:07 am
by najm
thanks it works but a little problem exists is that

1) when i select Blank Value for view those records which are null but it show all records as well as Entered values but i only wants null records.


2) and when i select any entered value it shows only entered value it's ok.

Please resolve my problem no 1 .
and Thanks for taking Interest


Chears

Najm

Posted: Mon May 08, 2006 6:11 am
by mirza_rehan
Assalam-o-Alaikum

Najam for this task lexical references are best and there is one way also soo please mail me you report i will corrected please mail me at: mirza_rehan@yahoo.com and if any urgency please call me

Best regards
R E H A N M I R Z A
System Analyst / Senior Oracle Developer
Cell: +92-304-2120807

When ever you pray
Please remember me and my family