>>>Is there a way to convert a character field to a numeric field? (I need it to be numeric so there is a decimal)
>>>
>>>Thanks,
>>
>>Ryan,
>>
>>...and I'll point out the following:
CREATE CURSOR Foo (SomeNum N(7, 3))
>>m.somenum = '1234.56'
>>APPEND BLANK
>>GATHER MEMVAR
>>REPLACE SomeNum WITH m.somenum
Neither does insert work.
>
>I noticed this with APPEND FROM ARRAY as well.
>
>
>DIMENSION laArray(1,1)
>laArray[1,1]='1234.56'
>APPEND FROM ARRAY laArray
>Why does this work?
Just a SWAG, but I'd say VFP isn't doing any type checking with these commands. In the two instances I mentioned, a data type mismatch occurs. I noted some ago (late '80s/early '90s) a similar situation with the regular APPEND FROM command. I had to import an SDF file that contained a date. If you tried to do a straight APPEND at the time, the date field would always be empty. However, using a dummy table with identical field names and types, except that the date field was a character field, allowed me to first append into the dummy table, then append directly into the regular table and have the dates coverted automatically.
George
Ubi caritas et amor, deus ibi est