Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index

Le 11/10/2018 à 20:39, Adam Fenn a écrit :


From an DB administrator/designer's perspective, calculated field values
are not generally stored in the database if they don't need to be. A
view might solve your problem in this case, as a view is a kind of fixed
query. It should be possible to create a view that calculates the sum of
your two fields and then show that in a column of the view as the result
or total.

Alternatively, you could define a query that would calculate the total
value for you, but it wouldn't insert that value into a field
specifically designed to store the value (display only).

If you do want to insert the actual total value into a field so that it
is stored in the database table, then you would probably need to define
a trigger (or stored procedure) that performs the calculation each time
a change is made to either Fee1 or Fee2, or upon some other condition.

You don't say, however, which kind of db engine you are using and
triggers are not available for all database sources supported by LOBase
(for example Calc, CSV, text tables, Dbase).

If you didn't want to perform this automatic calculation and storage at
the database engine level, but at a user interface level, then you could
use a Basic macro to effect the calculation, insert the total value and
refresh the table/form after insertion.


To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
Privacy Policy:


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.