I have a field which is like the following 4444-4444-TestingItem1. Is it possible for me to extract the field up until 4444-4444. if so how would I do this? What function would I use within SSRS. Please note It could be any number of characters before the first dash and before the second dash.
How can this be achieved within SSRS?
You can use functions like MID(), LEFT(), RIGHT(), LEN(), INSTR() to get a part of string.
The First function returns the first value in a set of data after all sorting and filtering have been applied at the specified scope. The First function cannot be used in group filter expressions with anything except the current (default) scope.
instr = The instr function returns the position of the first occurrence of one string within another. This position is based on a 1 based index of the characters in the string.
In SSRS you can use LEFT
and InStrRev
functions:
=LEFT(Fields!YourField.Value,InStrRev(Fields!YourField.Value,"-")-1)
Let me know if this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With