Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A97: Text conversion to Number type

Status
Not open for further replies.

RonMcIntire

Technical User
Oct 12, 2002
166
US
All:

I have a table with a field of alpha numbers that I need to change to Number format. How do I do it? Any ideas?

Simply changing the field type in the table wipes out the column.

Ron McIntire
 
I would first ask, why? The only time you should store numbers as numbers is if you are going to be performing calculations on them. For instance, Social Security Numbers, Zip Codes, Phone Numbers are all numeric, but you don't add any of them together. If you don't do any mathematical calculations with these numbers, don't change them.

If I decided for some reason to do it anyway, I would BACKUP the database. Then I would create a new field in the table as the datatype you need. Then do an update query setting the new field = to the old field (you may have to convert the datatype in the query to get it to work, may not). Once you check that the information in the new field is correct, remove the old field.

Not sure if you will run into any issues with queries though by changing the datatype. I know that my front end would CHOKE if I changed something from a string to a number.

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top