strip out all text

bstice

Registered User.
Local time
Yesterday, 21:35
Joined
Jul 16, 2008
Messages
55
Hello all,

Is there a criteria that I can use to strip out all text value and just return numeric values? For Example:

If this were the value of a field "bstice50", is there a criteria to return just the 50. I can't use left and right functions because the numbers are located within different places in the field. Thanks

Brennan
 
yes there is. use a function:
Code:
function stripText(myValue as string)

  dim i as integer, newString as string

  for i = 1 to len(myvalue)
    if isnumeric(mid(myvalue, i, 1) then
      newstring = newstring & mid(myvalue, i, 1)
    end if
  next i

stripText = newstring

end function
With the SQL for the field then, write this:
Code:
SELECT striptext(table.field)
That should do it...
 

Users who are viewing this thread

Back
Top Bottom