Importing recovered foxpro table

seat172

Registered User.
Local time
Yesterday, 19:13
Joined
Jun 30, 2004
Messages
25
Guys, i have a recovered Foxpro table, the problen i have is the numbers have the wrong format. To be exact, 63 should be 0.63, 1200 should be 12.00, 4250 should be 42.50. In other words i need to put in a decimal place two places to the left of each number. How do i do this on import i? Do i have to run a query and make a new table? If so what function and expression do i use?

Many Thanks :)
 
Err, just divide them by 100. 63/100 equals .63, 1200/100 equals 12.00, etc. This is a separate process after you do the import. The code would be like this (and you can just use a query as well):

Code:
UPDATE 
    Your_Imported_Table_Name 
SET 
    Your_Imported_Table_Name.Field_To_Divide_By_100 = 
    (Your_Imported_Table_Name.Field_To_Divide_By_100)/100
;

Make sure your Field_To_Divide_By_100 is a "Single" data type to handle the decimals.
 
Foxpro import

Thanks for that, how dum am I? Don't answer that, the feild is text and i am not sure all the records are numbers but it will certainly work for those that are. There are 1.4 million records and i aint checked them all!

Thanks for pointing out the obvious, more thinking less working next time.

If it aint broke it's probably German.
 
If there are some text and some numeric, the VAL function will still work on all the fields:

Val(123) = 123

and

Val("123") = 123
 

Users who are viewing this thread

Back
Top Bottom