Convert Text field to Number Field

G

Guest

I have a field that is formated as 123-45-6789 in text format with a field
length of 50. I need to convert it to a number IE: 123456789. I cant get it
to convert because of the "-" is there a way to do this?
 
J

John W. Vinson

I have a field that is formated as 123-45-6789 in text format with a field
length of 50. I need to convert it to a number IE: 123456789. I cant get it
to convert because of the "-" is there a way to do this?

If this is an identifier (it looks like a Social Security Number by the
format) then I'd say you DON'T want to convert it to a Number datatype. Will
you be doing arithmatic with it?

To keep it as a Text field but just remove the hyphens, run an Update query
updating it to

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

Also remove any Input Mask on the table field or form control which might be
introducing the punctuation.

John W. Vinson [MVP]
 

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