data type conversion

slrphd

Registered User.
Local time
Today, 13:23
Joined
Jan 6, 2004
Messages
91
I am having trouble doing a data type conversion. I have a legacy table that contains numeric data in text format and I wish to convert it back to numeric. I looked through some of the examples in here but cannot get them to work. The approach I would like to use is to add a new column to my table and use a query to make the conversion. The expression that I wrote is:

CDbl( [FF_INITIALU] ) As FF_InitialMTU

but I get the error message saying my expression contains invalid syntax. Am I making something very simple more difficult that it really is? Any suggestions will be greatly appreciated. Thanks.
 
I am not sure I fully understood your post, but you should look into something more like this:
Code:
FF_InitialMTU = CDbl([FF_INITIALU])
 
Newman said:
I am not sure I fully understood your post, but you should look into something more like this:
Code:
FF_InitialMTU = CDbl([FF_INITIALU])

I tried your suggestion early on and could not get it to work (at least in my hands). My original surmise was correct: I was making a simple problem far too difficult. I did find a solution that worked and it is dirt simple:

1. Create a new query based on the table in question;
2. Add a new field to the query with the expression Val(FF_INITIALU);
3. Run the query to test (it worked);
4. Redo the query as a MakeTableQuery and run to the create the desired table.

Then all I had to do was rename the field in the new table and delete the old table and I was in business. A coworker suggested that I simply change the data type in the original table but that did not work for me. I am beginning to wonder if I can do the simplest operations. Anyhow, thanks for your interest and your suggestion.
Sincerely,
 

Users who are viewing this thread

Back
Top Bottom