5 Replies Latest reply on Nov 21, 2014 11:21 AM by philmodjunk

# Determine if the Field Contains a Specific Character

### Title

Determine if the Field Contains a Specific Character

### Post

I can not Get this in my Head. I have a Field that Contains A Value Similar to This

2x      @5.99

Of Course the 2x can be 100x and the \$5.99 Can be \$100.99 I Want to Look at this Field and If The Data in this Field looks Like this, I want to be able to Select the 2 (or Whatever it is) and Copy it to a Feild in another table

If I Use Left() it is only Vaild when It equals exactly what I use, Im not getting how to Look at Just the x, Then Select the Number directly to The Left of it..
Again My Problem is How I Determine that This is the Field I want to Select from.
Thank  You

• ###### 1. Re: Determine if the Field Contains a Specific Character

This looks like data that should not be all in one field to begin with.

LeftWords ( "2x @5.99" ; 1 )

will return "2x"

RightWords ( "2x @5.99" ; 1 )

will return @5.99

There is also a MiddleWords function.

• ###### 2. Re: Determine if the Field Contains a Specific Character

Thank You for that, it gave me a little better understanding of  Left and Right Words but Im still unclear on what to do, maybe Im not Explaining it correctly

In that line There is Also Space so it Really Looks Like

'  2x                  @\$5.99      '

So I Need to Do 2 Things with this in my Script, Because it has the x and the @ all I Really want is the 2, if it does not contain this data (the x and the @), then I move on to the Next field

• ###### 3. Re: Determine if the Field Contains a Specific Character

WIthout that space between the two values, the Left words function will not work to return just the first item.

GetAsnumber ( Leftwords ( YourField ; 1 ) )

would return just the 2.

• ###### 4. Re: Determine if the Field Contains a Specific Character

Sorry I don't Move on to the Next Field, I Move on to the Next Record...

• ###### 5. Re: Determine if the Field Contains a Specific Character

I don't know what that has to do with answering a question about how to extract data from a field.