July 27, 2010 at 11:26 pm
Hi,
Can any one know how to get the first, middle & last words from the below Word, Using mid,left,right, Instr functions like substr & Instr in Oracle
First~Middle~Last
Thanks in Advance
July 28, 2010 at 4:12 am
Use the Split function, e.g.
=Split(Fields!Words.Value, "~").GetValue(1)
=Split(Fields!Words.Value, "~").GetValue(2)
=Split(Fields!Words.Value, "~").GetValue(3)
July 28, 2010 at 11:10 pm
Hi,
It is a great function 🙂
But the problem is, when using this function it is displatying #ERROR.
"The Value expression for the textbox ‘Col1’ contains an error: Index was outside the bounds of the array."
the data in that field is NULL, probably it might be the reason..
So I have used
"=iif(isnothing(Fields!Col1.Value)="NULL", "",Split(Fields!Col1.Value, "~").GetValue(1))"
Still same #ERROR
any other thing which I can do here. 🙁
July 28, 2010 at 11:54 pm
It's because Iif is a function and all parameters are evaluated before the function itself is evaluated. Try something like
=Split(Iif(IsNothing(Fields!Col1.Value), "~~", Fields!Col1.Value), "~").GetValue(0)
BTW: The array object returned by Split is zero based, so 0 is the first element.
July 29, 2010 at 1:34 am
thanks Peter Brinkhaus
Seems it is working fine 🙂
thanks alot
August 12, 2010 at 11:11 pm
Hi...
Am using the below function as you mentioned. At that time, there is no data, so i habve tested on test data and is working fine.
now, my report is still showing #ERROR when there is no data...
=split(
iif(IsNothing(Fields!Access_Granted.Value),"",Fields!Access_Granted.Value)
,"~").GetValue(1)
Please suggest..
Thanks...
August 13, 2010 at 3:03 am
deepthik (8/12/2010)
Hi...Am using the below function as you mentioned. At that time, there is no data, so i habve tested on test data and is working fine.
now, my report is still showing #ERROR when there is no data...
=split(
iif(IsNothing(Fields!Access_Granted.Value),"",Fields!Access_Granted.Value)
,"~").GetValue(1)
Please suggest..
Thanks...
You must use the string "~~" (just the two separators) if your field is null, not an empty string. "~~" will be split into 3 empty strings, where a split of "" will result in an array of just one empty string. In this case GetValue(1) (the second element of the array) will result in an error because there's only one element in the array.
Peter
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply