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

Help with the instr, mid functions please

Status
Not open for further replies.

AnnetteB1305

Technical User
Aug 17, 2011
166
GB
I have a field hardware type which I need to only display the second section of the field. i.e an example of the field is:-
English -> Hardware -> Computer (Handheld) -> Fan and I just want to display Hardware. I am trying to use the instr and mid functions but I can't get this to work without doing three different formulae to get what I require.

Thanks in advance

Annette
 

If the field is always populated with the first three elements, and you're always looking for the third one, then this is all you need:

split({HardwareType}," -> ")[3]

If that's not the case, then a different approach is needed - please supply more sample data.


 
No that's great why didn't I think of split however I am getting an error message a subscript must be between 1 and the size of the array
 
Just checked and they don't always have 3 elements however I only want to show the fields that do have 3 elements
 


if ubound(split({HardwareType}," -> ")) >= 3

then

split({HardwareType}," -> ")[3]

else

"Whatever you want to display"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top