Hope that someone can help me out on this one.
I have a query and I need to sum the VAT_Amount field and show it in a Label. The code I have shows me the sum but I need to show all the records from Client_Name as well. When I use this code it only shows me one row with the total.
with DM.iv_query do
Active := False;
SQL.Text := ('SELECT * FROM input_vat WHERE Client_Name = :Client');
// SQL.Text := ('SELECT SUM(VAT_Amount) AS tmpTotal FROM input_vat WHERE Client_Name = :Client');
ParamByName('Client').Value := tmpClientName;
Active := True;