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!

Instr formula or something similiar 1

Status
Not open for further replies.

DrHabi

Technical User
Jan 22, 2002
103
US
Hi,
I am in need of of formula that would allow me to search a field for a mark such as "/" then take the next character( which will be a number). I have been playing around with using instr and have not been to successful but maybe I need to do an array search. What the main goal is that I will have a field called {package.id} and within this field will be a "/" then a number. Based on this number I will do certain calculation. The length will not be set but random. Any suggestion would be great ly appreicated.
Thanks,
Jim
 
You should be able to use Instr() to accomplish this.
Code:
If Instr({table.field},"/")>0 then
    Mid({table.field},(Instr({table.field},"/")+1),1);
//Else
   //whatever condition you need if the / is not present

~Brian
 
Thanks but I somehow clicked twice for the same post the formula that I used is
Val(Mid({packages.id},InStr({packages.id},'/')+1))

It works great
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top