Ask Your Question

Simple Multiplication in Base

asked 2017-11-17 00:16:03 +0200

Blacksmithkazuma gravatar image

OK, I am probably thinking way to hard and searching. But I can't seem to find an answer. I am trying to Get a Total from two Amounts via Multiplication. I am very new to Base. I have read that SELECT"A" + "B" method, But no idea where to input that. Any help would be appreciated or links, I just can't seem to find a proper solution. Thank you much.

Using Libre Office Base V x64

edit retag flag offensive close merge delete


Hello, Need some further clarification. Where are the two amounts coming from? Table fields? Controls? Where is the result going to? Table field? Control? Is this a result of a Query? Please be clear on what you are trying to accomplish & what you have.

Ratslinger gravatar imageRatslinger ( 2017-11-17 00:27:43 +0200 )edit

That is hard, because Not sure. I have a a Client Order List that is a simple design. 6 slots for items, quantity, price and total. I am trying to multiply the Quantity and price to get the total. I can use the data from both the Table and a Quarry. Sorry for the late reply.

Blacksmithkazuma gravatar imageBlacksmithkazuma ( 2017-11-17 03:17:23 +0200 )edit

if anything i could possibly send you the odb file.

Blacksmithkazuma gravatar imageBlacksmithkazuma ( 2017-11-17 03:18:40 +0200 )edit

Basic DB design - don't store information which can be generated from other fields. If you need this figure later on, it can be generated as in the sample provided. Did you look at it?

Ratslinger gravatar imageRatslinger ( 2017-11-17 03:20:47 +0200 )edit

It blocked the Macros, not sure how to reenable them

Blacksmithkazuma gravatar imageBlacksmithkazuma ( 2017-11-17 03:25:33 +0200 )edit

The macro only applies to the CalcFields form. The QueryMultiply form should work without a problem.

Ratslinger gravatar imageRatslinger ( 2017-11-17 03:29:00 +0200 )edit

BTW - For macro enabling, from menu Tools->Options then under LibreOffice->Security select Macro Security button. On next dialog, select Medium. Click OK, OK & close & reopen .odb. When prompted, select Enable macros for the document.

Ratslinger gravatar imageRatslinger ( 2017-11-17 03:32:50 +0200 )edit

The Formula for the answer was confusing, I wont lie. But after a little more research I finally Figured it out. So between you answers and advice and another forum post I was able to figure it out. Thank you so much for your time and dealing with my lack of common sense haha

Blacksmithkazuma gravatar imageBlacksmithkazuma ( 2017-11-17 03:54:03 +0200 )edit

Not sure if you are aware but LO documentation is located here.

Ratslinger gravatar imageRatslinger ( 2017-11-17 03:56:17 +0200 )edit

One last question, I am using the QueryMultiply to do this. I have it written where my Total 1 table/query was at. I replaced with "Quantity 1"*"Price 1" in that column. It works once the Record is saved. But the "Total" on the Form does not save to the Table. How could I do that? if possible?

Blacksmithkazuma gravatar imageBlacksmithkazuma ( 2017-11-17 03:57:22 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-11-17 01:58:33 +0200

Ratslinger gravatar image


While waiting for a reply I put a sample together. There are two forms: QueryMultiply and CalcFields.

QueryMultiply uses a simply query as it data source:

SELECT "Name", "Amount1", "Percent1", "Amount1" * "Percent1" AS "CalcTotal", "ID" FROM "Table1"

And uses that to display the result. Of course the result is only available after the record is entered.

CalcFields uses a macro to get the result of the amounts entered in the Numeric fields.

Sample: SQLselect1.odb

If this answers your question please click on the ✔ (upper left area of answer).

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-11-17 00:16:03 +0200

Seen: 455 times

Last updated: Nov 17 '17