From: Dave on

"Damon" <nonsense(a)> wrote in message
> Hi,
> I have placed this under trim because if I used "Range =
> RTrim(Left(!m_add1, 7))" then that would bring back 129-179 but if it was
> 69-79 that would bring back 69-79 R. I wanted to be able to trim the r
> off. Also the reason I am doing the sum in the first place is to match it
> up with the recordcount to see if they are CONTINUOUS, if the sum is less
> than the recordcount I can work out if they are "EVEN" or "ODD".

OK, the suggestion I gave is still valid

Air Code

dim s() as string
dim i as integer
dim t as string
dim c as string

for i = 1 to len(!m_add1)
c = mid$(!m_add1,i,1)
if isnumeric(c) then
t =t & c
t = t & " "
end if
s = split(trim$(t)," ")

you now have the two numbers (as strings) in the array s

This will work for any delimiter and if there is only a single number it
will just return one element in the array.

This is just one rough & ready method, given more information about the
source data and its consistancy you should be able to come up with something
much better.

Dave O.

From: Mike Williams on
"Damon" <nonsense(a)> wrote in message

> I can work out if they are "EVEN" or "ODD".

If the format of the address is something like the format shown, and if you
assume that there are only even numbers (or only odd numbers) in a given
address range then you could do something like:

Range = (Val(Mid$(s1, InStr(s1, "-") + 1)) - Val(s1)) / 2 + 1

The above should return how many individual houses are included in the
range. If the format is likely to be different in some respects then you
will of course need to write a bit more code.


From: Mike Williams on
"Damon" <nonsense(a)> wrote in message

.. . . unless of course you have an address range like:

129 - 179 4th Avenue"



First  |  Prev  | 
Pages: 1 2
Prev: Network Drive Not Ready
Next: Soap 3.0 Error Help