Le 11/10/2018 à 20:39, Adam Fenn a écrit :
Adam,
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.
Alex
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
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.