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.
Author |
Topic |
SKP
Starting Member
34 Posts |
Posted - 2008-05-27 : 09:37:58
|
Hi Guys,I have a report where some fields are blank, i need to put 0 when the field is blank, i tried the following: IIf (Fields!X.Value = System.DBNull, 0, Field!X.Value)this is complaining about System.DBNull is a type in system and cannot be used in comparison, what other types of fields can I use here to compare against Empty data?is there anything basic I am missing? |
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
SKP
Starting Member
34 Posts |
Posted - 2008-05-27 : 09:53:09
|
Tried that, didn't work, actually the row for which there is no value for the field gets inserted by SQL Reporting Services when grouping the data and I am not sure what to compare this with, this data is not returend by SQL stored procedure rather introduced by SSRS to cope with Grouping of data and leaves this box as Blank. |
 |
|
SKP
Starting Member
34 Posts |
Posted - 2008-05-27 : 10:04:28
|
Hey Guys,I have solved the problem, when there is not data returend from Stored proc and SSRS inserts blank data to cope with grouping, it actually inserts default value of 0 if the field in question is int else blank string. So i just had to change to code to compare it against 0. |
 |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-05-27 : 10:07:49
|
This is VB? If so, then try:IsDBNull(Fields!X.Value)orFields!X.Value is DBNull.ValueIf neither of those work, then you don't really have NULL values, maybe empty strings ('') or nothing but spaces or something else.- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
|
|
|
|
|