Page 1 of 2

How to multiply 2 data fields?

Posted: Sun May 20, 2007 9:19 pm
by Chan Kuan Leang
Hi, I have just started using this stimulReport.net.

I have a questions & I hope someone in the forum can help me.

How do I create a calculated fields? For example, I want to multiply 2 data fields in the database together (Qty) * (Unit Price)

Thanks.

How to multiply 2 data fields?

Posted: Mon May 21, 2007 12:48 am
by Edward
Please see the following flash tutorial:

http://www.stimulsoft.com/livedemos/Rep ... ields.html

Thank you.

How to multiply 2 data fields?

Posted: Mon May 21, 2007 1:04 am
by Chan Kuan Leang
Edward wrote:Please see the following flash tutorial:

http://www.stimulsoft.com/livedemos/Rep ... ields.html

Thank you.
Thanks. I have saw it. But, it does not allow to multiply Data Type Double & Decimal
Is there another way to go about it?

Is there anyway to change the type or convert the data from Double to Decimal

Thank you so much.

How to multiply 2 data fields?

Posted: Mon May 21, 2007 1:25 am
by Edward
In the calculated column definition you may use any expression. The result of that expression must equals to the type of Calculated Column.
So you can type the following in the definition of the Column with decimal type:

Code: Select all

(decimal)Orders.EmployeeID*(decimal)Orders.Freight)
Thank you.

How to multiply 2 data fields?

Posted: Mon May 21, 2007 1:59 am
by Chan Kuan Leang
Edward wrote:In the calculated column definition you may use any expression. The result of that expression must equals to the type of Calculated Column.
So you can type the following in the definition of the Column with decimal type:

Code: Select all

(decimal)Orders.EmployeeID*(decimal)Orders.Freight
Thank you.
Thank you so much for helping to solve this problems.

How to multiply 2 data fields?

Posted: Mon May 21, 2007 2:02 am
by Edward
Let us know if you need any help.

Thank you.

Re: How to multiply 2 data fields?

Posted: Tue May 28, 2024 11:39 am
by fiorent
Hello. I applied that but it didn't work. The code was like that: {Sales.Quantity}*{Sales.Amount} and result was shown as 24*60.000. So, how can I do multiplication of two data on a table

Re: How to multiply 2 data fields?

Posted: Tue May 28, 2024 1:51 pm
by Lech Kulikowski
Hello,

You should use the following expression:
{Sales.Quantity * Sales.Amount}

Thank you.

Re: How to multiply 2 data fields?

Posted: Fri May 31, 2024 8:06 am
by fiorent
Lech Kulikowski wrote: Tue May 28, 2024 1:51 pm Hello,

You should use the following expression:
{Sales.Quantity * Sales.Amount}

Thank you.
It worked! Thank you so much :)

Re: How to multiply 2 data fields?

Posted: Fri May 31, 2024 8:50 am
by Lech Kulikowski
Hello,

You are welcome.