Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to remove anything before the space in the field 1

Status
Not open for further replies.

jeffm777

IS-IT--Management
Nov 10, 2009
108
0
0
US
Have a field with the following value...

ACURA LEGEND

I want to remove ACURA and the space before the word LEGEND so the formula returns only LEGEND.

I know how to get just ACURA...

if {Inventory.Model} startsWith 'ACURA' then left ({Inventory.Model},6) else {Inventory.Model}

but can't figure out who to get just the LEGEND.
 
Wouldn't you just use the RIGHT versus the LEFT to Get LEGEND? Not a pro but seems right. Give that a try and let us know.
 
Seems logical but the provided data was only an example...there's no way to tell how many characters will actually be after the word ACURA.
 
Got it...

if {Inventory.Model} startsWith 'ACURA' then Split ({Inventory.Model}, " ") [ 2 ] else
{Inventory.Model}
 
The following should also work:

right({string.field},((length({string.field})) - (instr({string.field}," "))))

Note that the instr will find the first blank field, not subsequent ones. Also, if the data could possibly be entered with a blank before ACURA, this will be an issue as well.
 
Hi N22S. Thanks for the post. That works very well. The only issue I'm going to run into is on a model such as SANTE FE, it only returns FE so I'm going to build some logic into the formula to account for these.

Tks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top