Oops! I didn't read closely enough. Hmmm...storing telephone and fax #'s as
numerics? What if the # begins with a zero? At the moment your area codes
may all begin with a number greater than zero but what happens of some
joker comes along and says he can only be reached in Switzerland and his
number is
01141-896-55678
Anywho, if you *know* that the only extraneous characters in the
telephone/fax #s are "." and "-" and you want "numerics pure" you could do
this:
sOphone = olddata("areacode") & olddata("phone")
sOphone=replace(sOphone,".","") ' remove "."
sOphone=replace(sOphone,"-","") ' remove "-"
sOphone=replace(sOphone," ","") ' remove " ", just in case
Regards,
-Toby
>----------------------------------------------------------------------
>
>Subject: Re: strings and integers UGGGGG
>From: "Daniel O'Dorisio" <dodorisio@h...>
>Date: Thu, 28 Jun 2001 09:47:20 -0400
>X-Message-Number: 9
>
>so after i do the string manipulation then i can format it like:
>n = 1234567
>n = format(n,"#######")
>
>and that will be the correct datatype for a numeric field in sql server?
>
>ill give that a shot as well.
>
>daniel
>
>Daniel O'Dorisio
>dodorisio@h...
>757-873-9290
>
>
>-----Original Message-----
>From: Toby Bascom [mailto:ThomasOBascom@c...]
>Sent: Thursday, June 28, 2001 6:06 AM
>To: professional vb
>Subject: [pro_vb] Re: strings and integers UGGGGG
>
>
>How about:
>
> n="123.4567"
> n= format(n,"###-#####")
>
>works the same for "1234567" and "123-4567"
>
>Regards,
>-Toby
>
>
> >Subject: strings and integers UGGGGG
> >From: "Daniel O'Dorisio" <dodorisio@h...>
> >Date: Wed, 27 Jun 2001 14:14:33 -0400
> >X-Message-Number: 31
> >
> >k i have a db, with a value in it. the db is access the value is of the
>type
> >text. i need to assign this value to a variable along with 3 other values
> >and update a sql db field of the type numeric with that data... is there
> >anyway to do this.
> >
> >p.s. right now i have the variable to get the data defined as a string
>since
> >the text in the db is a string. so i have:
> >
> >sOphone = olddata("areacode") & Left$(olddata("phone"), 3) &
> >Right$(olddata("phone"), 4)
> >sOfax = olddata("faxcode") & Left$(olddata("fax"), 3) &
> >Right$(olddata("fax"), 4)
> >
> >this will give me the correct string value. note the reason that i am using
> >the Left$ and Right$ is becaue of the data in those fields isnt all the
> >same.. some read 123-4567 and others read 1234567 while others read
> >123.4567.
> >
> >now i need to convert that string value to a numeric value.
> >
> >any help is much appreciated.
> >
> >