Changinf Field Format In Table With Data Definition Query ?

The Brown Growler

Registered User.
Local time
Today, 15:44
Joined
May 24, 2008
Messages
85
Hi,

I have a field in a table that is refreshed from external data that gets refreshed as a number field. Can I use a "Data Definition" SQL specific query to change the field format to text.

If it is possible would anyone please be able to illustrate the SQL query structure by way of an example for the objects [MyField] stored in [MyTable]. The [MyField] format is currently number but I wish it to be text.

Thx & Regards
 
From Help:

Use ALTER COLUMN to change the data type of an existing field. You specify the field name, the new data type, and an optional size for Text and Binary fields. For example, the following statement changes the data type of a field in the Employees table called ZipCode (originally defined as Integer) to a 10-character Text field:

ALTER TABLE Employees ALTER COLUMN ZipCode TEXT(10)
 
If you are refreshing this data, changing the datatype my cause a datatype mismatch on refresh. You could leave the table datatype as number and use a calculated field in a query to change it to text using Format or Str.
 
Thx for the replies, I will try the ALTER COLUMN option as I need to update the field at this point rather than have the numeric value cascade through to other tables that are relying on a text value.

Thx
 

Users who are viewing this thread

Back
Top Bottom