Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Name field needs to be opposite Post Reply Post New Topic
Author Message
server_sap
Newbie
Newbie


Joined: 09 Mar 2011
Location: Germany
Online Status: Offline
Posts: 14
Quote server_sap Replybullet Topic: Name field needs to be opposite
     Posted: 09 Mar 2011 at 10:19pm
Hi All,
 
I have an sql db field 'trainerName' which prints First Name and Last Name , i want to print Last Name first and then First Name , how can i achieve this using formula ?
 
Thanks to all in Advance
Regards
Server_Sap
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 10 Mar 2011 at 2:17am

Are the first and last names separated by a space? If so, then you could try:

trim(mid({table.field}, instr({table.field}, " ") +1))
& " "
& trim(left({table.field}, instr({table.field}, " ") -1))
 
If the names are separated by a comma, substitute "," for " " after instr(table.field},
 
|< /\ '][' ( )
IP IP Logged
server_sap
Newbie
Newbie


Joined: 09 Mar 2011
Location: Germany
Online Status: Offline
Posts: 14
Quote server_sap Replybullet Posted: 10 Mar 2011 at 3:03am
Thanks FrnhtGLI ,
 
works like charms Smile , you are the best .
 
by the way field is separted with space so didnt needed to change your formula much.
 
Thanks
Server
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum