Today I found that calculated cols with SQLite are CHARACTER fields! Is it true by it's nature or I have done some mistakes. Please check 3rd col of the SELECT statement. It should be NUMERIC (in SQLite it should be REAL).
Code: Select all
...
msql := "select invyear, invno, sum(netamt-paid) as dueamt from (select '"+;
_accyrid+"' as invyear, invno, netamt, 0.00 as paid from sale where custid = "+c2sql(mcustid)+;
" UNION select accyrid as invyear, invno, invamt as netamt, (invamt-dueamt) as paid from custbal where custid = "+c2sql(mcustid)+")"+;
" group by 1, 2"
table := sql(mdb, msql)
custpmt.custpmtdtl.deleteallitems()
for i = 1 to len(table)
if valtype(table[i, 3]) = "C"
table[i, 3] = val(table[i, 3])
endif
custpmt.custpmtdtl.additem({table[i, 1], table[i, 2], table[i, 3], 0.00})
next
...Thanks in advance
With best regards.
Sudip