Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Software and Programs A place where you can share links to Windows applications , Adobe , Microsoft , Rapidshare , Megaupload..

Software and Programs Thread, Trim name problem in Software & Hardware , Games; The Order Rep Names in my ODBC table appear as:Lastname, Firstname OR Lastname, Mi. Firstname I need to change them ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=16900


Reply
LinkBack Thread Tools Display Modes
Trim name problem
 
 
Senior Member

Reply With Quote
 
Join Date: Dec 2008
Posts: 18,122
14-01-2009, 04:10 PM
 
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 (Crystal Reports 2003) to appear as:Firstname Mi. Lastname When I do the same thing in a VBA report my...

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 (Crystal Reports 2003) 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,
 
 
 
Reply

Software and Programs Thread, Trim name problem in Software & Hardware , Games; The Order Rep Names in my ODBC table appear as:Lastname, Firstname OR Lastname, Mi. Firstname I need to change them ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=16900


Bookmarks

Tags
problem, trim


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump