1 (edited by v_pozidis 2016-01-22 13:24:02)

Topic: math in tablegrid

Hi,
I have a simple question.
in a TableGrid I have a column with a price, and a second for the VAT.
For the price I use the CALCULATED FIELD and a spript
SELECT column_name /1.23 FROM table_name        the VAT is 23%
For result I get the correct answer but when I add a new record I get the answer of the first record.
How can I solve it?

I include also my project

Post's attachments

Attachment icon Vat.zip 324.96 kb, 514 downloads since 2016-01-22 

Re: math in tablegrid

Hello,


Your calculated field should be

test*0.23
Dmitry.

Re: math in tablegrid

Hi Dmitry, i have the same question, but instead of adding 1.23 at the calculated field, i want the calculated field to get the value at the first ID from a table, if i can do so, i can edit the "VAT" field inside the program instead of going to the calculated field all the time

Re: math in tablegrid

VascoMorais wrote:

Hi Dmitry, i have the same question, but instead of adding 1.23 at the calculated field, i want the calculated field to get the value at the first ID from a table, if i can do so, i can edit the "VAT" field inside the program instead of going to the calculated field all the time

Hello,


calculared field:

pricefield*(SELECT IFNULL(vattable.vat, 1) FROM vattable WHERE vattable.id=1)
Dmitry.