Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 how to handle the null values in report

Author  Topic 

BCJ
Starting Member

42 Posts

Posted - 2008-06-24 : 15:15:38
Hi,

I have query like,

select field1,field2,field3 from table1 where
field1 = @p_id


here the requirement is, if the parameter is null still the report needs to run , how could i do that.

i mean the query something like,

select field1,field2,field3 from table1 where
field1 = isnull(@p_id,field1)
Thanks for your suggestions.....


tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-24 : 15:21:48
And what's wrong with the second query you posted?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

BCJ
Starting Member

42 Posts

Posted - 2008-06-24 : 15:33:36
when i tried to run the report with second query and without the parameter value , it didn't work. asked for enter the value for p_id , the parameter cannot be blank.
thanks.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-24 : 19:31:14
quote:
Originally posted by BCJ

when i tried to run the report with second query and without the parameter value , it didn't work. asked for enter the value for p_id , the parameter cannot be blank.
thanks.


The problem is not with the query. You need to supply a value to a parameter. Otherwise define parameter with default value(say NULL) and run the report without passing a value

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

BCJ
Starting Member

42 Posts

Posted - 2008-06-25 : 13:14:47
Thanks for the reply , i have selected multi_value, Null as default value and non-queried as available values, while running the report without value , still getting the error message 'Please enter the value for 'p_id'. parameter cannot be blank' . anything i have to do with 'allow blank value'(right now it is in disabled mode in the report parameters window)...........
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-25 : 13:53:08
did you checked allow null value property? Also do you have null among your available values as well?
Go to Top of Page

BCJ
Starting Member

42 Posts

Posted - 2008-06-25 : 15:48:54
I have checked allow_null_value and unchecked multi_value , it is working now, thanks.
Go to Top of Page
   

- Advertisement -