On Fri, Mar 25, 2016 at 3:35 PM, rafael copquin rcopquin@fibertel.com.ar wrote:
Both Ted and Richard, thank you for replying.
However, the resulting cursor has the fields as numeric.
In the case of the table belonging to the database that behaves normally, the sql column is numeric(10,2) and vfp brings it as a numeric(12,2) field.
In the case of the one that behaves crazily, the sql column is numeric(18,2) and vfp brings it as numeric(20,2)
If I browse the first cursor (both are saved to disk to deal with after the queries) it shows the amount in the invtotal column as 12345.67 which is correct
The weird one, even though it is showing the structure as numeric(20,2) shows as 12.345,67 and when the cursor is on the record it shows as 123.45, which is completely wrong. Note the dot separating the thousands, which does not appear in the first case.
I solved the issue temporarily by casting the fields as character in the select from the sql server and the resulting cursor is then CASTed to numeric(12,2).
I suspect Laurie's on to something, and that your getting the misplaced decimal place because the size of the numeric field exceeds the maximum width.
What if you were to cast the result as a numeric N(15,2) or smaller?