473,386 Members | 1,827 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,386 software developers and data experts.

Best way to test text data for alphanumeric characters

167 100+
I am hoping for suggestions on the best way to handle this. I am importing data from an excel spreadsheet into an access .mdb. One column on the spreadsheet ('colA') is in text format and is imported into a table in text format. I have to read the imported data and insert into production tables. The problem is 'colA' is being inserted into a column on the prod table this has a datatype of double. If the imported data in this column has an alpha charater, it is a bad value. These should only be numeric values... however, I have to handle the bad data coming in on the import. If I have the data in a column defined as text, how can I test to see if it contains a 'non numeric' character so my insert doesn't blow!!
THanks
Nov 16 '10 #1

✓ answered by Mariostg

IsNumeric() function will return -1 for 123, 0 for ABC, 0for abc3. You could test with that.

2 2721
Mariostg
332 100+
IsNumeric() function will return -1 for 123, 0 for ABC, 0for abc3. You could test with that.
Nov 16 '10 #2
Oralloy
988 Expert 512MB
Use an error trap ON ERROR and numeric conversion cnum
Nov 16 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: lawrence | last post by:
Someone on www.php.net suggested using a seems_utf8() method to test text for UTF-8 character encoding but didn't specify how to write such a method. Can anyone suggest a test that might work?...
3
by: Daniel Tonks | last post by:
OK, here's possibly a weird one. Is there any way to do string comparisons and ignore all non-alphanumeric characters? For instance, check "foobar" and have it match an existing record of "f$#!oo...
5
by: adrian | last post by:
hi all this is my first post to this group, so pls bear with me while i try to make some sense. i am trying to create a sproc which uses dynamic sql to target a particuar table eg. '.' and...
1
by: Avnish | last post by:
Hi, I am looking for some form of validation for all the alphanumeric characters in the entire unicode range e.g. the validation should also accept japanese characters but should restrict...
12
by: John | last post by:
Hi How can I select records that have non-alphanumeric characters in a field using a select query? Thanks Regards
1
by: Yasin Cepeci | last post by:
Password length minimum: 7. Non-alphanumeric characters required.I ve taken this error. Microsoft Security Policy requires something nonsense I think. I never think a password like "75256asdf!^+%&"...
7
by: kr | last post by:
Hi All, Suppose I consider a sample program as given below:- #include<stdio.h> #include<stdlib.h> int i; int main() { char *test(int i); char *tmp = NULL;
5
by: DotNetNewbie | last post by:
Hi, I want to parse a string, ONLY allowing alphanumeric characters and also the underscore '_' and dash '-' characters. Anything else in the string should be removed. I think my regex is...
3
by: DotNetNewbie | last post by:
Hi, I want to parse a string, ONLY allowing alphanumeric characters and also the underscore '_' and dash '-' characters. Anything else in the string should be removed. I think my regex is...
2
by: obkfixx | last post by:
help.. i have a problem.. how do u catch non alphanumeric characters?? it created an error on my program since the field type on the database is varchar... when i inputed admin\ on the...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.