Joined: 08 Jun 2007
Online Status: Offline
Posts: 27
Topic: Select text, conv to numb compare Posted: 27 Nov 2012 at 8:23am
Hello,
I am trying to do a comparison on the pkg size of two items. Each line below is in one text field so I need to extract the text quantity, convert text to a number and then compare the numbers. (The comparison is no problem but I can't seem to get the text out.)
The text field length varies but the number is always at the end. The package size format can vary as well. IE. Pkg/100 or Pkg 100.
widget 3 1/2" blue Pkg/100
widget 3 1/2" blue Pkg/10
Baby blue Caddy with pink trim Pkg 100
Baby blue Caddy with pink trim Pkg 10
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 27 Nov 2012 at 8:31am
You might be able to extract the number by using the InStrRev function along with the Right function. The problem arises with two different kinds of delimiters for the number (a space or a slash). The other way that might work better is use the Mid function and start at the right side of the string and work backwards until you find a non-numeric character.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum