function tdm.donnenombrelivcam(i:integer):integer; var nb : integer; begin ds.CommandType := cmdText; ds.CommandText := 'SELECT COUNT(code_camion) FROM livraison WHERE (code_camion=' + IntToStr(i) + ') AND (date_livraison > { fn NOW() })'; ds.Active := true; nb := ds.Fields[0].AsInteger; ds.Active := false; result := nb; end;