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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Convert Text field to Number Field
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? |
#2
|
|||
|
|||
Convert Text field to Number Field
Val(Replace(NameOfField, "-", ""))
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "davedinger" wrote in message ... 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? |
#3
|
|||
|
|||
Convert Text field to Number Field
On Tue, 5 Jun 2007 13:19:03 -0700, davedinger
wrote: 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] |
Thread Tools | |
Display Modes | |
|
|