2
Probably the title of this question is not correct, the case is that I would not know how to explain my doubt without an example.
I have a scenario where I need to add up the values of products that have not yet been delivered, ex:
My Records:
+-----------+------+------------------+------------------+
| Product | Qty. | Qtdentregue | Unit value |
+-----------+------+------------------+------------------+
|. Box ..|.. 5 .. |......... 2......| .... 30,00.......|
+-----------+------+------------------+------------------+
|... Ball...|.. 8 .. |.......... 4......| .... 50,00.......|
+-----------+------+------------------+------------------+
I’d like you to exhibit:
+-----------+------+------------------+------------------+--------------------+
| Product | Qty. | Qtdentregue | Unit Value | Pending Value |
+-----------+------+------------------+------------------+--------------------+
|. Box ..|.. 5 .. |............ 2......| .... 30,00....|..... 90,00.........|
+-----------+------+------------------+------------------+--------------------+
|... Ball...|.. 8 .. |............ 4......| ..... 50,00....| .... 200,00.......|
+-----------+------+------------------+------------------+--------------------+
Basically, I need to add a COLUNM
in each ROW
making a certain calculation to display the result:
- COLUMN
"Value Pending" displaying Remaining Value of Product not delivered:
Qty - Qtdentregue * Unit Value = Pending Value
And how to add up all these values after the display ?
I do not believe that the SUM(ValorPendente)
It will serve this case.
Would that be a select ? or you want to create a column even in your table?
– Marco Souza
Only one view, one Select, no need to store.
– Maurício Sanches