change text 444 445 888 to 444445888, number field access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an access table

change text 444 445 888 to 444445888, number field access
change text 444-445-888 to 444445888 as a number field in access
 
You can use the Replace() function to remove a space, dash, or any other
character.
After the non-numeric characters have been removed you can use the Val()
function to convert the text to a numeric value ...

R. Hicks
 
I have an access table

change text 444 445 888 to 444445888, number field access
change text 444-445-888 to 444445888 as a number field in access

Either

Val(Left([fieldname],3) & Mid([fieldname],5,3) & Mid([fieldname],9))

or

Val(Replace(Replace([fieldname], "-", "")," ", ""))

will do it in either case, if all of the text fields are of the same
layout.

Note that it may not be a good idea: Number (Long Integer) fields are
limited to 2^31, just over 2 billion; if these "numbers" are
identifiers (like phone numbers or Social Security numbers), they
should be left as Text. You can use either of these function calls to
strip out the blanks and/or hyphens and just leave digits.

John W. Vinson[MVP]
 
Sierra,

Just a hint for the future, if you don't mind... If you feel it is
important for your question to appear in more than one newsgroup (in
practice this is seldom necessary), it is preferable to cross-post (i.e.
address the same message simultaneously to both groups), rather than
multi-post (i.e. send a separate copy of the message to each group).
Thanks.
 

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

Similar Threads


Back
Top