A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Extracting the numbers from the Text Field



 
 
Thread Tools Display Modes
  #11  
Old April 22nd, 2010, 02:13 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Extracting the numbers from the Text Field

To expand on Ken Snell's observation.

If you are checking one character at a time then IsNumeric will return false
for any character that is not in the range 0 to 9.

If you are checking an entire string of multiple characters at once then you
can end up with unexpected results if all you want is just the number
characters.

IsNumeric can return true if there are commas or only one period in the
string. Also it can return true if the string can be read as a scientific
notation number (1.043E4) or (1.034D5). And it seems to ignore
one currency symbol (at least the $ sign)
one negative sign
one plus sign
parentheses around the number.

Probably a few other things to. Basically if a human (computer savvy) would
read the string as a just number then IsNumeric seems to return true.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Ken Snell wrote:
Also, IsNumeric will allow decimal points, etc. to remain as characters in
the string as well, so it sometimes is not a good choice when wanting just
numbers to remain.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.