Move first word in a field to the end of the field

Build your list of AccuZIP6 commands by requesting commands and sharing commands with other users

Moderators: Chrissy, Steve, Terry, Donna, Dave, Eric, MartyH, Kristen, Geoff, Vince

Post Reply
User avatar
Eric
Moderator
Posts: 1909
Joined: Tue Sep 19, 2006 3:29 pm
Contact:

Move first word in a field to the end of the field

Post by Eric » Tue Mar 23, 2010 8:32 am

The following command will take the first word in a field and move it to the end of the field. For example:

Smith John and Tracy

will change to:

John and Tracy Smith

and

Smith John

will change to

John Smith

Code: Select all

Replace first with substr(ALLT(first),at(" ",alltrim(first))+1)+" "+left(first,at(" ",alltrim(first))-1) for occur(" ",alltrim(first))>0
Chat with an AccuZIP6 technician weekdays from 7-4 PST with AccuZIP6 Live Online Support

Post Reply