473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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!
Jul 19 '05 #1
2 1397
Joey wrote:
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?

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"
Jul 19 '05 #2
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" <no****@infosmiths.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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!

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: eje | last post by:
IsNumeric(value) should return false if value "can not be successfully converted to a Double." Instead I get the following error message: "Input string was not in a correct format." I use the...
4
by: Eugene Anthony | last post by:
I have received the following feedback for the two functions bellow: "The ISNUMERIC test is WORTHLESS for checking for an INT value, because ISNUMERIC will happily accept DOUBLE values, such as...
3
by: Phil Powell | last post by:
'GET THE HTML CONTENT FOR DISPLAY BAND ORIGIN Dim bandOriginDropdown On Error Resume Next set scraper = Server.CreateObject("Microsoft.XMLHTTP") if err then bandOriginDropdown = "" else...
3
by: martin | last post by:
Hi, is there a dotnet function (other than the old isnumeric from VB) to check whether an object is numeric or not. also I notice that all the old vb functions such as split / isnumeric /...
4
by: John A Grandy | last post by:
IsNumeric() and IsDate() are "leftovers" from the VB6 days ... looking forward, perhaps it would be better not to use them .... does anyone have suggestions on replacements ?
10
by: michele | last post by:
I have a problem with VB.Net and IsNumeric() function because it always returns FALSE even the string can be a number. There is another strange thing, the same program (it is a test) runs good on...
7
by: Nathan Truhan | last post by:
All, I think I may have uncovered a bug in the IsNumeric function, or at least a misunderstanding on functionality. I am writing a Schedule Of Classes Application for our campus and have a...
7
by: Vikas Kumar | last post by:
For Each item In Request.Form If IsNumeric(item) Then Try Approved(item) Catch ex As Exception Response.Write(ex.Message) End Try End If Next
12
by: sck10 | last post by:
Hello, I am trying to determine if a value is NOT numeric in C#. How do you test for "Not IsNumeric"? protected void fvFunding_ItemInserting_Validate(object sender, FormViewInsertEventArgs...
17
by: MLH | last post by:
I have tested the following in immed window: ?isnumeric(1) True ?isnumeric(1.) True ?isnumeric(1.2) True ?isnumeric(1.2.2)
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.