Mid question in SSRS

ielamrani

Registered User.
Local time
, 20:02
Joined
May 6, 2008
Messages
51
Hi,
I am trying to retrieve a number from a field where it's between = and =
I have tried mid

=mid(Fields!PRE_LAB_VAL.Value,4,4)

but not working

PRE_LAB_VAL --------------------------Result

PT=45.7=02/07/2002-----------------45.7
RTS=51=02/07/2002------------------51
RT=26=02/07/2002--------------------26

Thank you
 
Look for instr function - something like this
Code:
Public Function FindBetweenEqual(MyString As String) As String
Dim MySearchString As String
Dim MyResultString As String
Dim MyResultString2 As String
Dim FirstEqualPosition As Integer
Dim SecondEqualPosition As Integer
FirstEqualPosition = InStr(1, MyString, "=")
Debug.Print "position of equal sign is " & FirstEqualPosition
MyResultString = Right(MyString, (Len(MyString) - FirstEqualPosition))
Debug.Print MyResultString
SecondEqualPosition = InStr(1, MyResultString, "=")
MyResultString2 = Left(MyResultString, SecondEqualPosition - 1)
Debug.Print MyResultString2
FindBetweenEqual = MyResultString2
End Function

Somewhat the same on the SQL Server side
http://www.sqlservercentral.com/Forums/Topic1330327-2846-1.aspx
This topic uses two different delimiters instead of two "=" characters.

My guess would be to use this code to create a new field with just the values and use that in the SSRS field selection.
 
Last edited:
thank you for your quick response.

I tried but did not work. I am new in ssrs.
 
I think you want the Charindex and SubString functions.

Wayne
 

Users who are viewing this thread

Back
Top Bottom