extract value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i need assistance extract the following

12345 from 3001-12345Y
653 from 2007-653Z
23 from 4009-23p

thank you
 
Asuming by your example that there are always 5 digit before to get rid of,
and one digit in the end to get rid of. if it not the case then you cant use
it

mid("3001-12345Y",6,len("3001-12345Y")-6)
 
If the number of digits before the dash varies you can use this:

Mid({String},instr({string},"-",1)+1,len({string}-instr({string},"-",1)-1))
 
both worked great. thank you both for you help!

JLamb said:
If the number of digits before the dash varies you can use this:

Mid({String},instr({string},"-",1)+1,len({string}-instr({string},"-",1)-1))
 
actually when I use the following with a field named test I am getting #Error
in my query:

Expr1: Mid([test],InStr([test],"-",1)+1,Len([test]-InStr([test],"-",1)-1))

any ideas??
 

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