remove letters from an alpha-numeric field

G

Guest

i have a text field that has an alpha-numeric field (the first three digits
are letters followed by either 6 to 8 numbers) example AUX12345678 and i need
to remove the letters and just extract the numbers.

how do i do this?

james
 
D

Dirk Goldgar

JamesMSMBA2005 said:
i have a text field that has an alpha-numeric field (the first three
digits are letters followed by either 6 to 8 numbers) example
AUX12345678 and i need to remove the letters and just extract the
numbers.

how do i do this?

james

If it's always the first three characters you want to drop, use the
Mid() function in a query expression:

Mid([YourField, 4)

That will return everything from the 4 character on.
 
G

Guest

What would be the command to display the results if an alpha character were
found ANYWHERE in the field?

Dirk Goldgar said:
JamesMSMBA2005 said:
i have a text field that has an alpha-numeric field (the first three
digits are letters followed by either 6 to 8 numbers) example
AUX12345678 and i need to remove the letters and just extract the
numbers.

how do i do this?

james

If it's always the first three characters you want to drop, use the
Mid() function in a query expression:

Mid([YourField, 4)

That will return everything from the 4 character on.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
U

UpRider

This will do it

Function fcnStripAlpha(strString) As Long
Dim x As Long
Dim zz As Variant
For x = 1 To Len(strString)
If IsNumeric(Mid(strString, x, 1)) Then
zz = zz + Mid(strString, x, 1)
End If
Next x
fcnStripAlpha = zz
End Function

UpRider

DubbleD said:
What would be the command to display the results if an alpha character
were
found ANYWHERE in the field?

Dirk Goldgar said:
JamesMSMBA2005 said:
i have a text field that has an alpha-numeric field (the first three
digits are letters followed by either 6 to 8 numbers) example
AUX12345678 and i need to remove the letters and just extract the
numbers.

how do i do this?

james

If it's always the first three characters you want to drop, use the
Mid() function in a query expression:

Mid([YourField, 4)

That will return everything from the 4 character on.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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