Converting Table with Text fields to number fields

TylerTand

Registered User.
Local time
Today, 12:43
Joined
Aug 31, 2007
Messages
95
I have a table that is imported from a file using code I didn't write. The Table Structure uses text fields, but the values are numbers(Commodity prices). Is there a way that I can convert the fields to number or do some sort of make table query to put the values into number fields? I am trying to do a number of calculations and think that the reason for the errors is that the values in the fields are text and not numbers. Any help is greatly appreciated.
Tyler
 
Simple Software Solutions

I would suggest you change the field types in your recently imported tables to the correct field types. Then strip out all the data then run an import into an existing table. Nominate the revised table.

CodeMaster::cool:
 
If DCrake's solution isn't practicable, use a query to extract the numeric values. You could use Val() or CDbl() functions to do this.
 
I am trying to do a number of calculations and think that the reason for the errors is that the values in the fields are text and not numbers.

As a first step do not try to store your calculated fields in the table as this goes against database practices.

As regards your other problem either set the datatype to Number or else use the Val() function to convert your text values to number.
 

Users who are viewing this thread

Back
Top Bottom