Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    1

    Unanswered: Alphanumeric text to numbers

    I have a database field that has a free format Alphanumeric field (text string), I need to be able to extract just the numbers from this filed, is thier a way of stripping away the text to be left with just the numbers.

  2. #2
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421

    Lightbulb

    Paste below function and call it...

    Function getNumbers(SomeString As String) As Double
    Dim I As Double
    getNumbers = 0
    For I = 1 To Len(SomeString)
    If Mid(SomeString, I, 1) Like "#" Then getNumbers = getNumbers & Mid(SomeString, I, 1)
    Next I
    End Function



    It works like so...
    ?getnumbers("uaksghfj234 akjlfhkjlh567")
    234567

    Greetz & GL

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Nice trick!!

    I didn't know you could use LIKE "#" for numeric comparisons.

    Good to know!
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •