Change text to number

  • Thread starter mohsin via AccessMonster.com
  • Start date
M

mohsin via AccessMonster.com

Hi

In one field, have a mix decimal and hexa numbers (10,12,17,30A, ..) with
text format. I need to change the format as a numbers.
I used Cint(field A), working for 10,12,17, but errors for 30A,

Can someone guide me please, what a the correct function/query to use?

Thank you
-mohsin
 
A

Allen Browne

Use IsNumeric([MyField]) to test if the entry can be understood as a number.

Some of the entries that Access considers numeric may surprise you, e.g.:
-29.4E-2
 
J

John Spencer

The big problem here could be the ambiguity between the numbers. Any value
stored that contains a letter could be assumed to be a hex number. BUT any
number that is represented with all numeric characters could be HEX or it
could be decimal. The string "1000" could represent 1000 in the decimal
system or if it is HEX and converted to decimal the value would be 4096.

The first question therefore is how do you know what 12 represents? Is that
Decimal 12 or is it hex 12 (decimal 18)?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top