Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 03:32 PM
Joey
Guest
 
Posts: n/a
Default using isnumeric

I am using an import process that scans an html file and exports data to
a sql database table.

One of the fields I import, on occasion has 2 numeric characters at the
very end. For example "thename 04".

What I need to do is delete those numeric characters, if they exist.

I thought about something like this:
if isnumeric(right(thename,2))=TRUE then

....but what's next? How do I make a new THENAME field without those
last two numeric characters if they exist?

Thanks for the help!


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2  
Old July 19th, 2005, 03:32 PM
Bob Barrows [MVP]
Guest
 
Posts: n/a
Default Re: using isnumeric

Joey wrote:[color=blue]
> I am using an import process that scans an html file and exports data
> to a sql database table.
>
> One of the fields I import, on occasion has 2 numeric characters at
> the very end. For example "thename 04".
>
> What I need to do is delete those numeric characters, if they exist.
>
> I thought about something like this:
> if isnumeric(right(thename,2))=TRUE then
>
> ...but what's next? How do I make a new THENAME field without those
> last two numeric characters if they exist?
>[/color]


To do it in vbscript, you would do this:

thename = left(thename,len(thename)-2)


Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


  #3  
Old July 19th, 2005, 03:33 PM
Manohar Kamath
Guest
 
Posts: n/a
Default Re: using isnumeric

You say "if they exist" -- meaning they may not? If so, you could do the
following:

Dim stringArray
dim namePart

' Split the string on the empty space
stringArray = Split(theName, " ")

' Retrieve the string before the space. if the space does not
' exist, you will get the entire string
namePart = stringArray(0)

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com


"Joey" <nospam@infosmiths.net> wrote in message
news:%23kPXamesEHA.2144@TK2MSFTNGP10.phx.gbl...[color=blue]
> I am using an import process that scans an html file and exports data to
> a sql database table.
>
> One of the fields I import, on occasion has 2 numeric characters at the
> very end. For example "thename 04".
>
> What I need to do is delete those numeric characters, if they exist.
>
> I thought about something like this:
> if isnumeric(right(thename,2))=TRUE then
>
> ...but what's next? How do I make a new THENAME field without those
> last two numeric characters if they exist?
>
> Thanks for the help!
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles