How do you remove all character to the left of an underscore?

  • Thread starter Mitchell_Collen via AccessMonster.com
  • Start date
M

Mitchell_Collen via AccessMonster.com

How do remove all character to the left of an underscore? I have tried Ltrim,
instr but that only trimming white spaces. Thanks in advance. -M

for instance:

name_23434.txt
name4_23454664.txt

should become:

23423.txt
23454664.txt
 
M

Mitchell_Collen via AccessMonster.com

(possibly the first underscore to the left)

Thanks - M
 
J

John Spencer

Try using an expression like
Mid(SomeValue,Instr(1,SomeValue & "","_")+1)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
J

John W. Vinson

How do remove all character to the left of an underscore? I have tried Ltrim,
instr but that only trimming white spaces. Thanks in advance. -M

for instance:

name_23434.txt
name4_23454664.txt

should become:

23423.txt
23454664.txt

Mid([fieldname], InStr([fieldname], "_") + 1)
 

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

Top