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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing Field

Status
Not open for further replies.

dcjames

Technical User
Nov 3, 2010
32
0
0
US
I have a field with the following data

0 10 12 ? * 2,3,4,5,6 *

What I'm looking to do is get only the info between the *. Ultimately I would like to do some sort of if statement

e.g. If {field name} in ['1','2','3'] then "Weekly" else ""

Thought that would work but unfortunately it doesn't.

Any help is appreciated
 
Does the data always contain 2 *s. If so you could use the following code to pull out the data between them"

Code:
Trim(Split({Table.Data},"*")[2])

Does that help?

Cheers
Pete
 
And if you wanted to then test that result and return "Weekly" if it contains a 1, 2 or 3 you could use the following:

Code:
If      Trim(Split({Table.Data},"*")[2]) Like "*1*" or
        Trim(Split({Table.Data},"*")[2]) Like "*2*" or
        Trim(Split({Table.Data},"*")[2]) Like "*3*" 
Then    "Weekly"

Hope this helps.

Cheers
Pete
 
Pete,

Thank you very much! This was exactly what I needed.

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top