Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    240

    Unanswered: Extract numeric data from mixed string

    Hi,

    Are there any functions that will extract numeric data from a string with text and numbers?

    I have created an OpenArgs function, but just want to use the numeric data.

    Thanks

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Iterate through the string using IsNumeric()
    oh yeah... documentation... I have heard of that.

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

  3. #3
    Join Date
    Sep 2005
    Posts
    240
    I gather I have to search through the alphanumeric string first, which would be something like the following as the number will always be on the end.

    Code:
    IsNumeric(Right(Me.OpenArgs, 4))
    But how would I get the value of the numeric part of the string, since IsNumeric will only return True or False?

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    So uhh... the last four characters of your string are always the number you're looking for?
    oh yeah... documentation... I have heard of that.

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

  5. #5
    Join Date
    Sep 2005
    Posts
    240
    Not necessarily it could be 1 digit, but then it could be 4 digits.

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Then you need to do the first suggestion. Iterate through each character and test it using IsNumeric...
    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
  •