ssrs 2008 - Getting the values in between -


in report builder 3.0 have string of comma separated values e.g. "value1, value2, value3, value4". have used split() first , last position how in between "value1" , "value4". can remove first , last position in array split function creates? result looking "value2, value3".

i can think of couple of methods:

=trim(split(fields!valuestring.value, ",")(1))   & ", "   & trim(split(fields!valuestring.value, ",")(2)) 

similar you're doing, concatenates 2 values together. trim helps avoid issues whitespace.

=trim(mid(fields!valuestring.value  , instr(fields!valuestring.value, ",") + 1  , instrrev(fields!valuestring.value, ",") - instr(fields!valuestring.value, ",") - 1)) 

this uses string manipulation based on comma positions. again trim used clean whitespace.

neither of these perfect when input string unexpected format, depending on data checks might required, value1, value2, value3, value4 both expressions return value2, value3 required.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -