The Order Rep Names in my ODBC table appear as:
Lastname, Firstname OR Lastname, Mi. Firstname
I need to change them in my Crystal report to appear as:
Firstname Mi. Lastname
When I do the same thing in a VBA report my code is:
Function ParseFirstComp(OrderRepName) As String
ParseFirstComp = "" 'set the default return value
If Not IsNull(OrderRepName) Then
Dim LPosition As Integer
'Find postion of space
LPosition = InStr(OrderRepName, " ")
'Return the portion of the string before the space
If LPosition > 0 Then
ParseFirstComp = Left(OrderRepName, LPosition - 2)
End If
End If
End Function
Function ParseSecondComp(OrderRepName) As String
ParseSecondComp = "" 'set the default return value
If Not IsNull(OrderRepName) Then
Dim LPosition As Integer
'Find postion of space
LPosition = InStr(OrderRepName, " ")
'Return the portion of the string after the space
If LPosition > 0 Then
ParseSecondComp = Mid(OrderRepName, LPosition + 1)
End If
End If
End Function
And then in my query:
Trim ({OptimizeIt.OrderRepName}) ([Expr2] & " " & [Expr1])
Can someone provide me the code so I can do the same in my Crystal Report? I expect I would put the code in a formula.
Thanks,