Skip to content Skip to sidebar Skip to footer

How Can I Calculate Sql Tables In Delphi ?

Hi I have sql table I want to calculate all the fields to total sum field.

Solution 1:

You can do this in the SELECT statement you use to get the data, something like

SELECT *, big1 + small1 as"TotalSum"from adlar

Obviously, you can add more numeric fields to the fields to sum.

Solution 2:

procedure TForm1.Button1Click(Sender: TObject);

begin

ADOQuery1.Close;

ADOQuery1.SQL.Text:='select boyuk1 + kicik1 + qara1 + boyuk2 + kicik2 + boyuk3 * 0,35 as totalsum from adlar2v'; //(table name:adlar2v)

ADOQuery1.Open;

end;

Post a Comment for "How Can I Calculate Sql Tables In Delphi ?"