Find a string

  • Thread starter Thread starter kingston via AccessMonster.com
  • Start date Start date
K

kingston via AccessMonster.com

Left(Mid(Mid(string,Instr(string,"-")+1),Instr(Mid(string,Instr(string,"-")+1)
,"-")+1),Instr(Mid(Mid(string,Instr(string,"-")+1),Instr(Mid(string,Instr
(string,"-")+1),"-")+1),"-")+1),5)

I hope I got all of the parentheses right. Anyway, you get the idea.
 
The following should work

Mid(TheString,
Instr(Instr(Instr(1,TheString,"-")+1,TheString,"-")+1,TheString,"-")+1,5)

Each Instr starts at the position + 1 of the inner Instr.
 
Thanks for the help-worked great,
K

John Spencer said:
The following should work

Mid(TheString,
Instr(Instr(Instr(1,TheString,"-")+1,TheString,"-")+1,TheString,"-")+1,5)

Each Instr starts at the position + 1 of the inner Instr.
 
I have a string of numbers:

40-M-06-03147-01

I would like a function to return 03147 from the string.

There will always be 3 dashes in the string before the 5 number string I
want to retrieve.

Thanks in advanve for any help

K.

How about fixing your clock. Today is the 19th.
 
fix the date on your PC, please. i can never figure out the international
dateline thing, but it's 1:31 pm Sat 10/21/06 where i am - it can't possibly
be later than Sun 10/22/06 anywhere else in the world....and it's certainly
not 10/29/06.
 
I have a string of numbers:

40-M-06-03147-01

I would like a function to return 03147 from the string.

There will always be 3 dashes in the string before the 5 number string I
want to retrieve.

Thanks in advanve for any help

K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top