January 13, 2011 at 8:48 am
Hi All
Im using BIDS to design a report.
In a calculated field I am using the below statement:
=iif(Fields!COSTYPE.Value = M,"Available", "Reconciled")
But it keeps errors on the M Character.
Ive checked the character definately exsist in the field and I have tried "" '' {} [] around the M to no avail. Just says unidentified Character.
How ever if i put a number there, any random number its ok.
any Advise?
Thanks
R
January 13, 2011 at 9:59 am
All the sites I'm seeing show that the conditional variable, if characters, needs to be in quotes.
=iif(Fields!COSTYPE.Value = "M","Available","Reconciled")
looks like the right syntax.
(not an ssrs expert)
perhaps it's a data type error, hence the error for "M" and not numbers. maybe convert the field before evaluation?
January 14, 2011 at 2:20 am
How would I convert it to string, Ive tried var(Field) and char(field) to no avail.
January 14, 2011 at 6:29 am
format(expression,[optional string format])
So perhaps you could format the whole thing like this?
=iif(format(Fields!COSTYPE.Value = "M","Available","Reconciled"))
I believe format is the appropriate function.
Again, I'm just trying to throw ideas out there until someone more knowledgable comes along. This is the kind of thing that I would spend a while playing with until I got it to work.
January 14, 2011 at 6:33 am
thanks, the reason I needed it as a field was so I could group, but I found if I can create a group by an expression, so I added the oringal coe =iif(Fields!COSTYPE.Value = M,"Available", "Reconciled") as a group expression and it worked!
January 14, 2011 at 6:46 am
January 14, 2011 at 8:44 am
I know after looking at it for ages I feel relieved.
But it is still would be a problem if i wanted to use this code as a field on the report.
So if anyone has any ideas please do share!
Thanks
R
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply