Move first word out of a field and leave remainder

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: 1910
Joined: Tue Sep 19, 2006 3:29 pm
Contact:

Move first word out of a field and leave remainder

Post by Eric » Tue Jul 01, 2008 2:38 pm

The command below moves the first word out of the field called First and puts it into the field named Last, and leaves everything else in the First field:

Code: Select all

Replace last with left(first,at(" ",alltrim(first))-1),first with SUBSTR(first,at(" ",ALLT(first))+1) for occur(" ",alltrim(first))>0
If you have a comma immediately after the first word, then run this command instead:

Code: Select all

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

Post Reply