The fields in my query that are important to this issue are:
TAX_IND tax deductible indicator for the line item.
AMT REAL field with a dollar amount for the line item.
TaxAmt result of query.
NonTaxAmt result of query.
The query is basically:
SELECT
c.TAX_IND as TaxInd,
c.AMT as Amount,
case c.TAX_IND when '1' then c.AMT else 0 end as TaxAmt,
case c.TAX_IND when '0' then c.AMT else 0 end AS NonTaxAmt
FROM csCONDTL c
A small sample of data from the query:
Code: Select all
TaxInd | Amount | TaxAmt | NonTaxAmt
1 | 5.37 | 5.37 | 0
0 | 12.30 | 0 | 12.30
The problem is that in SQLite the query fields TaxAmt and NonTaxAmt are returned as an "Unknown" datatype. I thought the fix would be to use the UniDac DataTypeMapping like:
query.DataTypeMap.AddFieldNameRule('TaxAmt', ftExtended, True);
query.DataTypeMap.AddFieldNameRule('NonTaxAmt', ftExtended, True);
When I do this I get the error above. I've also tried to change the query text to "cast" the TaxAmt and NonTaxAmt values as real "cast(c.amt as real) as TaxAmt". This did not change the result.
Any suggestions?
Thanks in advance!