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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting a table from text to number in a query

Status
Not open for further replies.

motoguy

Technical User
Sep 9, 2002
6
US
Is there a way to modify a field in a table from text to number? I am working with an imported (from excel)table that has fields that are text that do not work in subsequent queries. I would like to modify the table as part of a macro that does some data scrubbing. Till now I have been doing it manually under table design.
TIA,
Motoguy
 
One way is to run a query with the following syntax - this example changes a text field PhoneCode in a table tblCountry to a long integer type:

Code:
ALTER TABLE tblCountry
ALTER COLUMN PhoneCode LONG;

[pc2]
 
You lost me. I wrote an SQL statement using the above but I get a message "Syntax error in ALTER TABLE statement"
Thnanks for your help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top