Topic: Math-calcul

Hi everybody,
how i can i do subtraction of  the result of a Sum (Total) and the result of another Sum (total),
it's for a takings project.
Thank You smile

Re: Math-calcul

Hello.


The answer depends on exactly where you want to see the result?

On of the options

var
   s: string;
begin
   s := SQLExecute ('SELECT TOTAL(field1) FROM TableName1') - SQLExecute ('SELECT TOTAL(field2) FROM TableName1');
   ShowMessage(s);
Dmitry.

3 (edited by Joyce Solo 2019-05-29 12:56:35)

Re: Math-calcul

here is an example :



thanks in advance

Post's attachments

Attachment icon subraction.jpg 132.81 kb, 4 downloads since 2019-05-29 

Re: Math-calcul

Example

function CalculateFooters: double;
begin
    result := Form1.TableGrid1.Columns[0].Footer.FormulaValue - Form1.TableGrid2.Columns[0].Footer.FormulaValue;
end;

procedure Form1_TableGrid2_OnChange (Sender: TObject);
begin
    Form1.Label1.Caption := FloatToStr(CalculateFooters);
end;

procedure Form1_TableGrid1_OnChange (Sender: TObject);
begin
    Form1.Label1.Caption := FloatToStr(CalculateFooters);
end;
Dmitry.

Re: Math-calcul

Thank you! I'll try

6 (edited by Joyce Solo 2019-05-30 09:00:45)

Re: Math-calcul

HI,
DriveSoft here is the file,

Post's attachments

Attachment icon invoice from Joyce Solo.zip 541.51 kb, 22 downloads since 2019-05-30 

7 (edited by Joyce Solo 2019-05-30 09:02:32)

Re: Math-calcul

My question is in this image

Post's attachments

Attachment icon question.jpg 277.9 kb, 6 downloads since 2019-05-30 

Re: Math-calcul

Unfortunately you use cracked version of application. Support on the forum only for legal users.

Dmitry.

Re: Math-calcul

yes sir smile

Re: Math-calcul

Sorry that, Dimtry!

i'll buy your software.

But i realy need your help to understand.

                         Thanks