Topic: SQL .Value decimals
I get an error "Could not convert variant of type (UnicodeString) into type (Double)"
I'm trying to get details of a currency field with decimals displayed on form viaSQL.
To get the currency decimals using:
FORM2.edPriceType01.Value := SQLExecute('SELECT PriceType01 FROM Product WHERE id='+FORM2.tgProducts.sqlValue);
Instead of
FORM2.edPriceType01.Text := SQLExecute('SELECT PriceType01 FROM Product WHERE id='+inttostr(FORM2.tgProducts.dbitemid));
All OK, until I add clear fields script for product form. I need to clear type details when different product type.
Please see the attached sample project.
----------------------------------------------------------------
EDIT:
After some trial and error I found that; instead of clearing fields, making them 0.00 eliminates the above mentioned error message.
Doesn't work:
frmProduct.edPriceType02.Clear;
Works:
frmProduct.edPriceType02.Value := 0.00;
If the above approach is incorrect please let me know.
God... please help me become the person my dog thinks I am.