Author |
Topic |
Dutchie75
Starting Member
22 Posts |
Posted - 2009-01-03 : 10:12:44
|
I have the following calculated field:=iif(IsNothing(Fields!Code.Value) or Fields!Code.Value = "","NOT YET CODED",Fields!Code.Value & " - " & Fields!Code_Description.Value)This formula works fine if the Fields!Code.Value has a value (ex. "Code A - Code A Description" is displayed), but if it's null or blank, all that displays is " - ". I'd like it to display "NOT YET CODED". I've also tried it without the hyphen and no go.Thanks in advance! |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-03 : 10:21:41
|
try any one of below=iif(Len(Fields!Code.Value)=0,"NOT YET CODED",Fields!Code.Value & " - " & Fields!Code_Description.Value)or =iif( Fields!Code.Value > "",Fields!Code.Value & " - " & Fields!Code_Description.Value,"NOT YET CODED") |
|
|
Dutchie75
Starting Member
22 Posts |
Posted - 2009-01-03 : 10:45:48
|
Unfortunately, no go. I tried both. The code is a string value, and I know the darn thing is null. Anything else? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-03 : 14:07:57
|
try this too=iif(Fields!Code.Value <> Nothing,Fields!Code.Value & " - " & Fields!Code_Description.Value,"NOT YET CODED") |
|
|
Dutchie75
Starting Member
22 Posts |
Posted - 2009-01-03 : 14:43:17
|
I totally thought your suggestions would work (they makes so much sense), but unfortunately it didn't. I think there must be something funky going on with that particular field in the back end (the datasource comes from some old dbase tables), because IsNothing works for every other expression I implement. When I have more time, I'll look into this further. For my immediate purpose, I will simply add a text box with a legend note for the users. Thanks for the efforts though. Much appreciated. Of course, any other suggestions are always welcome! :) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-04 : 03:50:53
|
quote: Originally posted by Dutchie75 I totally thought your suggestions would work (they makes so much sense), but unfortunately it didn't. I think there must be something funky going on with that particular field in the back end (the datasource comes from some old dbase tables), because IsNothing works for every other expression I implement. When I have more time, I'll look into this further. For my immediate purpose, I will simply add a text box with a legend note for the users. Thanks for the efforts though. Much appreciated. Of course, any other suggestions are always welcome! :)
Are you sure that the field contain null value? isnothing will work only if its a null value and not work if value is "null". please keep in mind that "null" is not equal to null |
|
|
Dutchie75
Starting Member
22 Posts |
Posted - 2009-01-04 : 13:23:30
|
After playing around more, I'm starting to think that there is something funky going on with that field in the back end (the datasource is derived from some pretty old dbase tables). It seems as if the field is null because there isn't any visible value. And IsNothing is working for all of my other null fields so..... I'll have to dig deeper there when I have more time. It's just weird that it works fine in Crystal. Anyheck, I'll do some testing and post back when I can. |
|
|
Dutchie75
Starting Member
22 Posts |
Posted - 2009-01-05 : 00:33:47
|
I did a quick test query asking for all records with a null code value, and the record in question did come up, so I knew that it was actually a NULL value. I could not, however, find any way to make IsNothing work through an expression with this field. But, I was able to do it by creating the formula field thorugh sql through the stored procedure with the following:"iif(code is null,'NOT YET CODED',code + ' - ' + code_description) CodeDescription "...with CodeDescription being the name of the new formula field. Go figure. Well, I'm happy to finally have it working regardless. Thanks so much for helping me think through this. I can now move on.... and for now, go to bed. |
|
|
|