I am building report in SSRS 2008 which queries Oracle. I have 3 text parameters build into dataset query - they should work in a way that if left blank they should include everything. If I put a value in each parameter - report returns value. But as soon as I remove one of the values - leaving box blank - report returns nothing (where in fact it should return more resulting rows). See query below. I was trying to troubleshoot it for some last 2 days , trying to find some onswers in the internet, looking at session details - no luck. I would appreciate any help, thanks.
select WI_NUM , COMPONENT_NUM , LOT_NUM
from CONS
where
(:WI_NUM = '' OR WI_NUM = :WI_NUM)
and
(:COMP_NUM = '' OR COMPONENT_NUM = :COMP_NUM)
and
(:LOT_NUM = '' OR LOT_NUM = :LOT_NUM)
I also tried that but same problem:
where
(:WI_NUM is NULL OR WI_NUM = :WI_NUM)
and
(:COMP_NUM is NULL OR COMPONENT_NUM = :COMP_NUM)
and
(:LOT_NUM is NULL OR LOT_NUM = :LOT_NUM)
All parameters are set as data type text, allow blanks, not allow nulls(not ticked).