analyze a string

  • Thread starter Thread starter Doug A
  • Start date Start date
D

Doug A

I need the code that will take a field of data where the
values have not been normalized but the names of the
company have actual unit numbers that should be in
anouther field. an example of the data

Big Joe company
baskins and robins 1
baskins and robins 2
Tradename

not all records have numbers, the numbers represent compny
units. the company units should be grouped with the
company and will not be included in the grouping on the
report.

If anyone has a suggestion it would be appreciated. thanks
in advance

Doug A
 
Not sure I have understood but I think you want to strip out the 1 and 2 and
put them in separate fields.

Just peel of the rh characters and check if they are numeric


If IsNumeric(Right(Str, 1)) Then
NewStr = Left(Str, Len(Str) - 2) '2 because of space between name and
number
Number = CLng(Right(Str, 1))
Else
..................

you need to work harder if double digits are possible.
 
Back
Top