View Full Version : Importing recovered foxpro table


seat172
02-06-2007, 01:03 PM
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 :)

Moniker
02-06-2007, 02:20 PM
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):

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.

seat172
02-06-2007, 02:33 PM
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.

Moniker
02-06-2007, 03:24 PM
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