EXTRACT DATA FROM FIELD

L

LOUIS

HI,
I have strings like
202/05/10
51/15/20
205/1/1

I would like to extract the numeric part of the strings

Pls help

Thanks

LouiS
 
K

KARL DEWEY

Replace([YourField], "/", "") will remove the slashes and leave the numbers.

Left_Part: Left([YourField], InStr([YourField],"/")-1)
Mid_Part: Right(Left([YourField], InstrRev([YourField], "/")-1),
Len(Left([YourField], InstrRev([YourField], "/")-1))-
InStr([YourField],"/")-1)
Right_Part: Right([YourField], Len([YourField])-InstrRev([YourField], "/"))

Mid part not tested - may need to be tweaked.
 
D

Duane Hookom

If all that needs to be removed are the "/" then you might be able to get by
with a simple find and replace. This depends on "the strings" being values in
a field in a table.
--
Duane Hookom
Microsoft Access MVP


S.Clark said:
Create a VBA function to look for and strip the slash "/" character. Call
that from the query.

e.g.

MyData: StripChars([Fieldname], "/")

Total Visual Sourcebook has code like this, and much, much, more:
http://fmsinc.com/MicrosoftAccess/SourceCodeLibrary.html

--
Steve Clark,
Former Access MVP
FMS, Inc
http://www.fmsinc.com/consulting

LOUIS said:
HI,
I have strings like
202/05/10
51/15/20
205/1/1

I would like to extract the numeric part of the strings

Pls help

Thanks

LouiS
 

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