Support 805.461.7300
Sales
Our Technology. Your Success.

Remove last word from a field

Description

This command will remove the last word in a field. The word "fieldname" in the command syntax below should be changed to the actual field name you want the last word removed from. This command will not affect records that contain only one word in "fieldname". You can adjust the ">0" clause so the command only acts on records with "n" numbers of spaces. Example, change ">0" to "=3" and the command will only affect records that contain "3" spaces (examples shown below).

The Command At Work

Before Command After Command
Before running command
After running command

The Command

Copy this command, then paste it into the large text area of the command window:

Replace fieldname with left(fieldname,rat(" ",alltrim(fieldname))) for occur(" ",alltrim(fieldname))>0

After clicking RUN, the excess data will be stripped from the field of choice, helping clean up the field.

« Back to Commands

I am especially motivated to take time to draw attention to Vince. In two instances, we potentially faced loss of product – significant loss, but thanks to everyone’s efforts, most notably Vince’s, we ended up with minor re-work and zero loss of stock. He’s patient and thorough, knowledgeable and resourceful. And he’s patient – A Big Plus when dealing with me. Long story short, the guy was able to not only produce a solution, but to prove to me the veracity of it. I hung up the phone saving thousands of dollars in catalog stock, not lost but salvaged, and my department had to spend just a wee bit of time on job re-work (which I was happy to do, all things considered). But I also hung up with a peculiar urge to write about Vince, incongruent as that may be since I rarely am moved to write letters of this sort. So… In a time of crisis, Vince was a terrific asset and ally. If I were his boss, I’d attempt a merit raise authorization, he was that exceptional.
H.D., Shawnee Mission, KS